单项选择题

Given:
12.Date date = new Date();
13.df.setLocale(Locale.ITALY);
14.String s = df.format(date);
The variable df is an object of type DateFormat that has been initialized in line 11.
What is the result if this code is run on December 14, 2000?()

A.The value of s is 14-dic-2000.
B.The value of s is Dec 14, 2000.
C.An exception is thrown at runtime.
D.Compilation fails because of an error in line 13.


您可能感兴趣的试卷

你可能感兴趣的试题

1.单项选择题

Given:

What is the result?()

A.int Long
B.Short Long
C.Compilation fails.
D.An exception is thrown at runtime.

2.单项选择题

Given:

Which statement is true?()

A.Compilation fails.
B.An exception is thrown at runtime.
C.Synchronizing the run() method would make the class thread-safe.
D.The data in variable "x" are protected from concurrent access problems.
E.Declaring the doThings() method as static would make the class thread-safe.

4.多项选择题

Given:

Which three changes should be made to adapt this class to be used safely by multiple threads?()

A.declare reset() using the synchronized keyword
B.declare getName() using the synchronized keyword
C.declare getCount() using the synchronized keyword
D.declare the constructor using the synchronized keyword
E.declare increment() using the synchronized keyword

5.单项选择题

Given:

What is the result?()

A.Compilation fails.
B.An exception is thrown at runtime.
C.The code executes and prints "running".
D.The code executes and prints "runningrunning".
E.The code executes and prints "runningrunningrunning".

6.单项选择题

Given:

What is the result?()

A.Compilation fails.
B.An exception is thrown at runtime.
C.The code executes normally and prints "sleep".
D.The code executes normally, but nothing is printed.

7.单项选择题

Given:

What is the result?()

A.Afoo Afoo
B.Afoo Bfoo
C.Bfoo Afoo
D.Bfoo Bfoo
E.Compilation fails

8.多项选择题

Click the Exhibit button.

Which three statements are true?()

A.Compilation fails.
B.The code compiles and the output is 2.
C.If lines 16, 17 and 18 were removed, compilation would fail.
D.If lines 24, 25 and 26 were removed, compilation would fail.
E.If lines 16, 17 and 18 were removed, the code would compile and the output would be 2.
F.If lines 24, 25 and 26 were removed, the code would compile and the output would be 1.

9.单项选择题

Given:

What is the result?()

A.Compilation succeeds.
B.Compilation fails due to multiple errors.
C.Compilation fails due to an error only on line 20.
D.Compilation fails due to an error only on line 21.
E.Compilation fails due to an error only on line 22.

10.单项选择题

Click the Exhibit button.

What is the result?()

A.go in Goban go in Sente go in Sente
B.go in Sente go in Sente go in Goban
C.go in Sente go in Goban go in Goban
D.go in Goban go in Goban go in Sente