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 of the following will increase the level of security for personal and confidential information on a mobile device if the d
Soloha48 [4]
I believe is a and c.
8 0
4 years ago
Some request lists might cause the disk scheduler to act the same when the three different algorithms are run. Create a request
storchak [24]

Answer:

35, 25, 50, 75, 95

Explanation:

List of five track numbers that will cause all three algorithms to visit the same tracks in the same order are -

35

25

50

75

95

Please go to attachment for the diagram how these 5 tracks will be traversed by various algorithms.

All the algorithms traverse in the order 35 -> 25 -> 50 -> 75 -> 95

7 0
4 years ago
Given the structure definition shown, assume that circle1 and circle2 are variables of the Circle type and their members have be
kolezko [41]

Answer:

False is the correct answer for the above question.

Explanation:

  • The structure is a user-defined data type, which is used to define the set of different data types and values. Just like in the above question, the class structure holds the list of three variables, which is a type of double.
  • When any user wants to compare the two structure values, then he can do it with the help of comparing all the variables of a structure. if a user wants to compare the circle1 with the value of the circle2, then he needs to compare the circle1.centerX with circle2.centerX, and so on with the other variables.
  • But the above question syntax will directly compare the two structure variable, which is not correct. Hence the above answer is false.
6 0
4 years ago
Given the following structure and variable definitions, struct customer { char lastName[ 15 ]; char firstName[ 15 ]; unsigned in
garri49 [273]

Answer:

see explaination

Explanation:

a)

customerRecord.lastName

b)

customerPtr->lastName or (*customerPtr).lastName

c)

customerRecord.firstName

d)

customerPtr->firstName or (*customerPtr).firstName

e)

customerRecord.customerNumber

f)

customerPtr->customerNumber or (*customerPtr).customerNumber

g)

customerRecord.personal.phoneNumber

h)

customerPtr->personal.phoneNumber or (*customerPtr).personal.phoneNumber

i)

customerRecord.personal.address

j)

customerPtr->personal.address or (*customerPtr).personal.address

k)

customerRecord.personal.city

l)

customerPtr->personal.city or (*customerPtr).personal.city

m)

customerRecord.personal.state

n)

customerPtr->personal.state or (*customerPtr).personal.state

o)

customerRecord.personal.zipCode

p)

customerPtr->personal.zipCode or (*customerPtr).personal.zipCode

6 0
3 years ago
Which of the following is an object-oriented programming language?
Svetradugi [14.3K]

Explanation:

This is the correct answer

<h3>python</h3>
7 0
2 years ago
Other questions:
  • A simple way to think of the Excel application is as a giant ______.
    5·2 answers
  • What is the correct posting of the journalized transaction shown in figure 3.03 to the accounts payable subsidiary ledger?
    9·1 answer
  • Which of the following is an object-oriented prototype-based language? Java Pike REBOL MATLAB
    9·1 answer
  • When a communication exchange that does not verify the identity of the endpoints of a communication and accepts any properly for
    10·1 answer
  • What are the examples of shareware?
    9·2 answers
  • Complete the sentence. <br><br> ____ Is the study and use of very small technology units
    14·1 answer
  • The replacer parameter of the stringify method accepts a/an ______________ or an array.
    15·1 answer
  • Use the drop-down menus to complete statements about archiving and backing up data fileArchiving data files manages the size of
    5·2 answers
  • Which of the following file formats allows you to share and save documents
    5·1 answer
  • How do you convert hexadecimal to denary
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!