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 has water influenced the development of civilization in Africa
Which is one type of play that Shakespeare wrote? A. histories B. musicals C. passion plays D. burlesques Question Resources
How do I do trebuchet calculations????? Help me please
What does hemostasis mean?
A recipe call for 2 cups of water for every 5 cups of flour. How many cups of water are needed for 1 cup of flour? A. 2 1/2 cups B. 2 cups C. 1/2 cup D. 2/5 cup
How do you put allele in a sentence
one-third of the fish in Liam's fish tank were added today. Half of the other fish were a gift to Liam last week. the other 9 came from Liam's old fish tank.
how can you write 0.45 as fraction and a percentage ,please show work
a summary about concussions
define concentric circles