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
Which command let’s you increase or decrease the on-screen magnification of your document
JulijaS [17]
Ctrl - and ctrl +       i hope that is good for you                         
8 0
3 years ago
Write a python program to calculate the length of any string recursively​
Solnce55 [7]

Answer:

b

Explanation:

6 0
2 years ago
When you create names for the elements of a webpage (such as ), what are some rules that you can follow to make your HTML code e
shusha [124]

Answer:

by using proper indentation

Explanation:

6 0
3 years ago
Read 2 more answers
When processing all the elements of row i of a two-dimensional array named grades using a for loop with variable j, what is the
kykrilka [37]

Answer:

D

Explanation:

Two dimensional array contain both rows and columns. Each row represented one record and each column represent one filed in that record.

for ex: int grades[5][3];

here array grades contains 5 rows and in each row we have 3 columns

if we have grades[i][j] then " i " represents number of rows and j represents the number of columns in that row.

j<grades[i].length represents i=0 to 2[here no of columns are 3, array index starts from 0 to 2]

The Answer is D

8 0
3 years ago
What do you call when a hacker users multiple guest computers to crack a password?
azamat

Answer: Botnet

Explanation:

Botnet is the process when a hacker user uses multiple guest computer to crack a password. Basically, hackers use botnet for performing the distributed denial of services attack in the network.

It also steal the data and allowed attacker to approach its connection and access its device.

Botnet word is the combination of robot and network and botnet can be controlled by using the command and control software.

6 0
3 years ago
Other questions:
  • Ron is creating building blocks in Word. How can he make the building blocks that he created available?
    11·2 answers
  • Criminal Investigation people called my house on an automated voice is this a scam ??
    13·1 answer
  • Can someone please help me? I have no clue what any of this is and how I'm going to find out 15 examples of these. It's due some
    5·1 answer
  • Describe Ms word environment.​
    14·1 answer
  • I am buying a BluRay drive access time is 180ms and the other is 210ms(BD-ROM) whats does access time mean
    5·1 answer
  • In which conditions, a trial balance does not tally?
    14·1 answer
  • What does this function do in the code?
    5·2 answers
  • What happened to the ten commandments tablets.
    9·1 answer
  • Question #1
    13·2 answers
  • What changes could you make so that a message, "User input deemed invalid." during designing a simple calculator program for you
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!