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

Which disorder includes depression and bipolar disorder
What was Cuba’s relationship to the US in 1898-1903?
A team of archaeologists excavating a sedimentary rock layer come across some primitive hunting tools used by early humans. As the dig progresses, they unearth
find the equation of the straight line passing through the point (0,-1) which is perpendicular to the line y=-3/4x-3
The difference between the Soviet Union and Great Britain in Europe after the war is which of the following? A. Great Britain did not want to control and of t
What’s the correct answer
Personal opinions and advice are appreciated and welcomed, no wrong answers, but i cant get organized with anything, not papers, a closet and definitely not
Simplify the question below.
What does the a small MAD tell you about a set of data
Containers for contaminated sharps must have certain features. What are these?