cecilia16cheng cecilia16cheng
  • 02-06-2021
  • Computers and Technology
contestada

Which of the following passes an int argument into a method named print? Chose one option and explain why.

o print();
o print()+5;
o print("5");
o print(5);

Respuesta :

fichoh
fichoh fichoh
  • 07-06-2021

Answer:

print(5)

Explanation:

Passing an int argument into the method named print ;

print() ; Here, the print method has no argument as it is empty

print()+5; Here also, the print method has no argument and adding +5 is an invalid syntax.

print("5") ; Here, print takes in an argument, however, the argument is a string due to the fact that 5 is enclosed by quotation marks.

print(5) ; Here, the integer is 5 is passed to the print method.

Answer Link

Otras preguntas

Employability skills are personal traits and attitudes which make individuals “________” or desirable to prospective employers. (10 letters)
draw a triangle ABC with vertices A(4,2), B(3,5)and C(6,5) on a graph paper. Reflect it on X=Y and show the image on the same graph paper.​
solve for Surface Area
How to find the measure of an interior angle inside a regular polygon
india has the largest art industry in the world. true or false?
What does GCWR stand for
There was a bottle of milk at home. After the brother drank 1.94L of it, there were 0.56L left. How many litres of milk was there at the beginning?
What are the strengths and weakness of gel electrophoresis ?
Indicate whether the two functions are equal. If the two functions are not equal, then give an element of the domain on which the two functions have different v
Using the digits 1, 3, and 5 only once, write the greatest and least three-digit numbers you can.