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
Digiron [165]
3 years ago
12

Given the following method definitions: void mystery(double a) { System.out.print("double! "); } void mystery(int a) { System.ou

t.print("int! "); } What will be the output of the following code? mystery(1); mystery(1.0); Select one:
a. It is impossible to predict
b. int! double!
c. Duplicate function names results in a compiler error.
d. double! int!
Computers and Technology
1 answer:
kicyunya [14]3 years ago
6 0

Answer:

The correct answer to the following question is option "b".  

Explanation:

The method having the same name but the arguments have different so it is called method overloading. It is a part of the object-oriented programming language (oops).  

  • In the given code we define same method two times that is "mystery()". but in this method, we pass two different parameters. For the first time, we pass a double variable that is "a" as a parameter. In the second time, we pass an integer variable that is "a" as a parameter and in both functions, we write some codes.
  • In the calling time, we call function two times. In first time calling we pass an integer value that is "1" and second time calling we pass double value that is "1.0". So the output of this code is "int! double!".  

That's why the option "b" is correct.

You might be interested in
Assslainsdffddsvvdesdssbhasasco5m
alexandr402 [8]
Hahahahaha I wanna was the day I wanna was the last time I got to
8 0
3 years ago
Read 2 more answers
What is the interface in Java programming Language? Why do we need to use it?
Alenkasestr [34]

To accustom to several different language-speaking countries. One program is often used internationally so having a language setup is very important.

6 0
3 years ago
The man-in-the-middle attack<br> means what
Tom [10]

Answer:

<em> where the attacker secretly relays and possibly alters the communications between two parties who believe that they are directly communicating with each other.</em>

Explanation:

4 0
3 years ago
To complete a forensic disk analysis and examination, you need to create a ____.
just olya [345]
<span>To complete a forensic disk analysis and examination, you need to create a </span>report.
8 0
3 years ago
. :
Rudik [331]

Answer:

Yes.  I completely agree.

Explanation:

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

7 0
2 years ago
Other questions:
  • Point mode allows you to select cells for use in a formula by using your finger or the pointer
    7·1 answer
  • A(n) ____ is a client, server, or other device that can communicate over a network and is identified by a unique number, known a
    10·1 answer
  • Convert each of the following for loops into an equivalent while loop. (You might need to rename some variables for the code to
    10·1 answer
  • There are two activities on your schedule, which are: 1) install server in lab 2) move server into the data center. however, the
    6·1 answer
  • Write a program C statement to declare and initialize an array named afTest1 type float to store
    11·1 answer
  • Nathan wants to create multiple worksheet containing common formatting styles for his team members. Which file extension helps h
    9·1 answer
  • When working on developing an ability, it is important to get feedback to know how you are doing.
    6·1 answer
  • Which of the following sentences is accurate? a. PDF stands for "Proofreading Direct Files." b. PDF files cannot be edited. c. B
    9·1 answer
  • What is the Slide Sorter View used for?
    12·2 answers
  • Write a program to enter length of a square and print area of square.<br>(class 8)​
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!