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

howcto write 9,000,009 in word form
A cliché is a _______ expression. A. worn-out B. foreign C. new D. wordy
what is the quotient of 43.8 and 12
During the 1930s, Japan took advantage of China's inner turmoil and annexed which mineral-rich region? A. Tibet B. Manchuria C. Korea D. Mongolia
Two atomic bombs were dropped on this nation, thus ending World War II. China Germany Soviet Union Japan
what are the pros and cons of the stamp act ?
Unit rate for 240 kilometers and 2.5 hours show your work
One case of books weighs 35 pounds. One case of magazines weighs 23 pounds.A book store wants to ship 72 cases of books and 94 cases of magazines to another sto
C6H12O6 is a type of protein carbohydrate amino acid polymer
if x equals 8-(-2.25) and y equals 6-4.2-(-4.9) what is the value of x-y