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

how did the atlantic slave trade lead to the stagnation of african cultures and economies
How might it be argued that the greek polis was destined for failure?
Without oxygen, a cell can obtain ____________ atp molecules.
The result of changing a physical sound wave into an analogous electrical signal using a transducer (such as a microphone) is called
A conflict resolution manual calls on "the first disputant " to state his/her case what does disputant mean in this context?
In "The New Colossus," the Statue of Liberty is compared to a/an A. mother. B. immigrant. C. European queen. D. door.
When constructing inscribed polygons how can you be sure the figure inscribed is a regular polygon
When constructing inscribed polygons how can you be sure the figure inscribed is a regular polygon
Given the trinomial 2x2 + 4x + 4, predict the type of solutions
What are the domain and range of f(x)=1/5x