Given the Java statement

number1 = input.nextInt();

in which number1 is an int and input is a Scanner, which of the following occurs if the user does not enter a valid int value?
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...

An operating system with _____ capabilities allows a user to run more than one program concurrently.

A. networking B. hardware independence C. memory management D. multitasking

Computer Science & Information Technology

What electronic file format facilitates the piracy of music?

(a) .gif (b) .mp3 (c) .png (d) .wav

Computer Science & Information Technology

What can you not do directly from the Backstage, Print screen view?

A) Select how much of the worksheet will be printed B) Switch to formula view and print formulas C) Set the page orientation D) Select which printer you want to use

Computer Science & Information Technology

Click the Distribute Rows Evenly button to change the row height to 0.3".

Answer the following statement true (T) or false (F)

Computer Science & Information Technology