Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The program displays NumberFormatException. The program displays RuntimeExceptio

ID: 3570885 • Letter: T

Question

The program displays NumberFormatException.

The program displays RuntimeException.

The program displays NumberFormatException followed by RuntimeException.

The program has a compilation error.

The program runs fine and displays two images.

new Image("www.cs.armstrong.edu/liang/image/us.gif") must be replaced by new Image("http://www.cs.armstrong.edu/liang/image/us.gif").

The image object cannot be shared by two ImageViews.

The addAll method needs to be replaced by the add method.

The program displays 60 10 50 30 40 20

The program displays 10 20 30 40 50 60

The program displays 60 50 40 30 20 10

There is no guarantee that the program displays 10 20 30 40 50 60

Which of the following statements is correct?

Generics can help detect type errors at compile time, thus make programs more robust.

Generics can make programs easy to read.

Generics can avoid cumbersome castings.

Generics can make programs run faster.

The program displays NumberFormatException.

The program displays RuntimeException.

The program displays NumberFormatException followed by RuntimeException.

The program has a compilation error.

Explanation / Answer

a) The program displays NumberFormatException followed by RuntimeException.

b)The addAll method needs to be replaced by the add method.

c)The program displays 60 50 40 30 20 10

d)Generics can make programs easy to read.