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
Develop a simple game that teaches kindergartners how to add single-digit numbers. Your function game() will take an integer n a
Lyrx [107]

Answer:

2 correct answer out of 3

5 0
3 years ago
Which website is important for hacking
Yuliya22 [10]

Answer:

Here's a few

Explanation:

  • SQL Injection attacks. SQL Injection attack is the most common website hacking technique. ...
  • Cross Site Scripting (XSS) ...
  • Denial of Service (DoS/DDoS) ...
  • Cross-site request forgery (CSRF or XSRF) ...
  • DNS Spoofing (DNS cache poisoning) ...
  • Social engineering techniques.

Glad I could help!!

6 0
2 years ago
What are some ways in which reading and writing have changed in our newly networked world
olga_2 [115]
Reading and writing have given us both a way to pass on knowledge and learn things we cant learn first hand.<span />
3 0
3 years ago
The freemen's bureau was the U.S.' first ____ program.​
Ludmilka [50]

Answer:

welfare

Explanation:

The Freemen's bureau was the first Welfare program in the US that was put forward in the year 1865 just after the assassination of Abraham Lincoln. It was headed by Oliver O Howard. And it was brought for providing the food, clothing, medical care, and education to the recently freed white refugees and the freed slaves. And it was supposed to be a kind of welfare.  

6 0
3 years ago
Which statements are true about a database?
anzhelika [568]

Answer:

you cannot leave a field empty

you can enter data based on the defined data type

6 0
2 years ago
Read 2 more answers
Other questions:
  • Will Give Brainliest!
    14·2 answers
  • Use the following data definitions data myBytes BYTE 10h,20h,30h,40h myWords WORD 3 DUP(?),2000h myString BYTE "ABCDE" What will
    9·1 answer
  • Write a program using nested loop to produce the following output:
    6·1 answer
  • What processes can move a solute against its concentration gradient?
    15·1 answer
  • How many spaces should you use for an indent?
    10·1 answer
  • How many pounds must a sand bag weigh to test if a safety net can absorb the proper amount of force? A. 150 lbs. B. 200 lbs. C.
    6·1 answer
  • Your organization network diagram is shown in the figure below. Your company has the class C address range of 199.11.33.0. You n
    8·1 answer
  • Hey im b---o---r---e---d dont report cuz if u do ur l a m e :)
    14·1 answer
  • Which pickaxe in minecraft to use?
    14·1 answer
  • Molly needs to access a setting in microsoft windows group policy to change the type of a network to which a computer is attache
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!