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

In a drawer of 10 pairs of socks, 3 are white, 4 are grey, 2 are black, and 1 pair is blue. What is the probability of randomly pulling out a white or blue pair
solve for x: 10/3 = x/(-5/2)
What is the difference between physical and behavioral traits?
What is the root number of 121?
Use the Distributive Property to write an equivalent expression. 12s+4+4s-2
Which statement best completes the diagram of the causes of the Haitian Revolution? A. Saint-Domingue's African population convinces the United States to suppor
I’m stuck on this question if someone could help me I would highly appreciate:)
Short notes on effects of drugs
Under the Articles of Confederation, Congress was unable to pass laws without a two-thirds vote from the states. Please select the best answer from the choices
Maya rides her bike in 3/4 of a mile in 1/2 hour. How far does she rides in 1 hour?