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
Which phone has the most GB (Gigo Bites)<br><br>A.Samsung<br>B.Iphone<br>C.LG<br>D.ZTE
Lina20 [59]
It's GigaBytes actually. And is it RAM or storage capabilities?

And also those are brands. Not models. For example, Samsung has different phones. Not just one.


7 0
3 years ago
Read 2 more answers
Which is true about SSH and Telnet?
MaRussiya [10]

Answer:

Data is encrypted on SSH

Explanation:

Telnet and SSH both are the networking protocols. These protocol are used for the security of data. In telnet data is sent over the link without any encryption. That is the reason, in telnet protocol data is less secure.

In SSH (Security Shell) protocol data has been encrypted before transmission. The encryption of data make it more secure between transmitter and receiver.

So the true statement is that, SSH has data encryption.

8 0
3 years ago
What is word processing?
butalik [34]
A. Citing sources for documents you found on the web
3 0
3 years ago
Read 2 more answers
30% of the mass of an objects is 24 kilograms. use this fact to find:
Triss [41]

Answer:

chemați. mfvd5. fn. cfcfcfcfcfcfcf 4t

6 0
2 years ago
When a table is displayed in datasheet view, each column represents a select one:
Ksivusya [100]
The answer a. record in the table.
5 0
3 years ago
Other questions:
  • _ effects determine how slide elements disappear
    11·1 answer
  • If a user wants to change one small section of the formatting of a document and leave the rest the same, which process should be
    14·1 answer
  • This type of method method performs a task and sends a value back to the code that called it:
    5·1 answer
  • Which is a copyright
    13·2 answers
  • All states that have altered judicial selection techniques in recent years have adopted some form of:
    5·1 answer
  • The force required to slide an object is equal to _____.
    13·1 answer
  • Match the context details with the pattern that applies.
    7·1 answer
  • What is the missing part to have the output as 3 2 1 while count &gt;0 : print(count) count -= 1
    10·1 answer
  • Which type of network allows backups and network security to be centrally located?
    11·1 answer
  • 8) how many nanoseconds does it take for a computer to perform one calculation if it performs 6.7 x 107 calculations per second?
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!