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]
2 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]2 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 technology concept uses computer resources from multiple locations to solve a common problem?
kramer

Answer: Sounds like you are talking about “Distributed memory systems” which use multiple computers to solve a common problem, with computation distributed among the connected computers (nodes) and using message-passing to communicate between the nodes.

8 0
3 years ago
While investigating the settings on your SOHO router, you find two IP addresses reported on the device’s routing table, which is
Semenov [28]

Answer:

Explanation:

Always the getaway is the first device in a network, and for that was assigned this IP address 192.168.2.1, is the first address of the block, a network getaway gives us interoperability between networks and contains devices, and is a protocol translator, this is a piece of hardware used for telecommunication networks.

8 0
3 years ago
Some of y'all make me lose braincells with your questions
boyakko [2]

Answer:

ok done we will try

BTW have a nice day enjoy your day Stay blessed stay happy stay strong

5 0
2 years ago
Read 2 more answers
Which of the following tasks would least help an individual achieve a goal to safely lose weight?
ozzi
To continue to look at motivational or inspirational quotes to remind them or to remember how far you have come and it is not time to give up!
7 0
2 years ago
Read 2 more answers
What conversion factor should be used to convert from meters to Gigameters?
hodyreva [135]
Meters * 1,000,000,000 = gigameters
5 0
2 years ago
Other questions:
  • If a class has member variables that are pointers, you must ensure that you implement ____.
    6·1 answer
  • The simplest method to copy information is to first select the information you want to copy, and then use the Copy button and th
    11·1 answer
  • Who all likes fortnite
    15·2 answers
  • A detective agency is looking to bust an arms sale. According to available intelligence, the sale is likely to happen in one of
    11·1 answer
  • Which types of scenarios would the NETWORKDAYS function help calculate? Check all that apply.
    15·1 answer
  • if anyone is on a Chromebook, do you ever mean to press backspace, then you accidentally press the power button and think "OH CR
    13·2 answers
  • Which element is represented by the electron configuration in example B? Example B: 1s22s22p63s23p64s1 Aluminum Cesium Potassium
    12·2 answers
  • 12.2 Sort an array in ascending order Write a program that gets a list of integers from input, and outputs the integers in ascen
    10·1 answer
  • A client is looking to maximize value from its Cloud investments by baselining, profiling, and prioritizing its human capital ne
    9·1 answer
  • marion is an iot developer working for a large organization. why does his supervisor want him to stay informed about the network
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!