Given the Java statement below, in which input is a Scanner, which of the following occurs if the user does not enter a valid int value?

int number1 = input.nextInt();

a. A compilation error occurs.
b. The program continues executing and assigns the value 0 to number1.
c. A runtime logic error occurs.
d. None of the above.


c. A runtime logic error occurs.

Computer Science & Information Technology

You might also like to view...

Which of the following information should you gather before you start to add an account in Outlook?

A. type of account B. the address of the incoming mail server C. the address of the outgoing mail server D. your email password

Computer Science & Information Technology

How does a line conditioning UPS protect network equipment?

a. It protects against electrical surges. b. It shields equipment from lightning damage. c. It reduces fluctuations in incoming voltage. d. It filters line noise from incoming power.

Computer Science & Information Technology

The __________ Act of 1966 allows any person to request access to federal agency records or information not determined to be a matter of national security.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

If you hear a hissing sound coming from the LCD, which component is most likely about to fail?

A. Battery B. Yoke C. Vacuum tube D. Inverter

Computer Science & Information Technology