1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Nonamiya [84]
3 years ago
6

Consider the following code: public static void mystery(int a) { System.out.println("A"); } public static void mystery(double a)

{ System.out.println("B"); } public static void mystery(int a, double b) { System.out.println("C"); } public static void mystery(double a, int b) { System.out.println("D"); } What is output by the following? mystery(7);
Computers and Technology
1 answer:
Feliz [49]3 years ago
3 0

Answer:

The output is "A"

Explanation:

public class Solution {

   public static void main(String args[]) {

     mystery(7);

   }    

   public static void mystery(int a) { System.out.println("A"); }    

   public static void mystery(double a) { System.out.println("B"); }    

   public static void mystery(int a, double b) { System.out.println("C"); }    

   public static void mystery(double a, int b) { System.out.println("D"); }

}

In the code above; mystery is defined in four different ways called method overloading. Method overloading is when same method is defined with different parameters.

In the first case; mystery will be called if the argument is int.

In the second case; mystery will be called if the argument is double.

In the third case; mystery will be called if the arguments are int and double.

In the fourth case; mystery will be called if the arguments are double and int.

When mystery(7) is called; the mystery method requiring only int will be called and the output is "A".

You might be interested in
What do people do when they navigate using GPS
Debora [2.8K]

Answer:

they use  it when they are driving and when they dont know where they are doing

Explanation:

7 0
3 years ago
Read 2 more answers
A program that contains the following method: public static void display(int arg1, double arg2, char arg3) { System.out.println(
Oduvanchick [21]

Answer:

The method can be accessible from main method of any class.

Explanation:

Main method is the entry point of a program, which means when you start you program the first thing to execute is the main method.

public static void main(String[] args){

// Your code here

}

In the given display method you have int, double and char data types as a arguments. So in order to call display method you need to understand the datatype that you want to pass.

int only takes integers without decimal points.

double take numbers with decimal points.

and char only tak one character

so in order to call display method we need to pass those arguments in right order.

Below is the main method which will call the display method in a right way

public static void main(String[]args){

  display(25,50000.00,'T');

}

Output

The values are 25, 50000.0, and T

7 0
3 years ago
Wireless networks use radio frequency (RF) or radio techniques, which allows wireless transmissions to reach out in all directio
tia_tia [17]

Answer: True

Explanation:

Yes, the given statement is true that that one of the quality of the wireless networks is that they uses the various radio techniques and the radio frequency.

 By using this techniques, the wireless transmission occur and it enable the connectivity and allow the direction of transmission to eavesdrop. It is one of the best technique as compared to the traditional method which include copper and fiber.

6 0
3 years ago
You are creating a program that can add up the amount of money the user spent that day. Right down to the penny! What kind of va
padilas [110]

Answer:A. A default Variable

Explanation:

5 0
3 years ago
Read 2 more answers
What are some of the challenges that could arise from setting up a file management system on a computer?
son4ous [18]
It could glitch out or be hacked or deleted.
8 0
3 years ago
Other questions:
  • It is safe to use your bright headlights if there is a car ahead of you within 300 feet
    9·2 answers
  • What is a independent variable
    11·1 answer
  • To copy noncontiguous slides, open Slide Sorter view, click the first slide thumbnail, press and hold ____, click each additiona
    15·1 answer
  • The marketplace is the essence of which of the following?
    11·1 answer
  • What is my favorite color?<br> Red<br>Orange<br>Yellow<br>Blue <br>Gold<br>Silver
    13·1 answer
  • Siapa mahapatih brainly.com atau yg disebut Brainly Amerika Serikat ?​
    5·1 answer
  • How dose society use computer in government?​
    5·1 answer
  • The transmission control protocol (TCP) layer helps computers to communicate in which of the following ways?
    10·1 answer
  • Question 2
    7·1 answer
  • One of 34 possible _________________ can be assigned to each axis of classification in the seven-character code.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!