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

When was World War I?
A child is standing across the street from his apartment . His mother is on their balcony . The angle of elevation between the child's eyes and his mothers eyes
Trying to translate word problems. Five times the sum of 3 and twice some number is 70. what is the number?
.is a pot holder a conductor or a insulator
A 1 digit number and a 3 digit number have a sum of 205.  The same two number have a difference of 195, a product of 1,000 and a quotient of 40.  What are the t
What are two different ways to describe and label the layers of the Earth?
.is a pot holder a conductor or a insulator
What is two thirds minus six thirds
When was World War I?
two identical freight cars roll without friction towards each other on a level track. one car rolls 2 m/s the other 1 m/s. after the cars collide they couple an