单项选择题

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.


您可能感兴趣的试卷

你可能感兴趣的试题

1.单项选择题

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

2.单项选择题

Given:

Which statement is true?()

A.The code will compile without changes.
B.The code will compile if public Tree() { Plant(); } is added to the Tree class.
C.The code will compile if public Plant() { Tree(); } is added to the Plant class.
D.The code will compile if public Plant() { this("fern"); } is added to the Plant class.
E.The code will compile if public Plant() { Plant("fern"); } is added to the Plant class.

3.多项选择题Which two code fragments correctly create and initialize a static array of int elements?()

A.static final int[] a = { 100,200 };
B.static final int[] a; static { a=new int[2]; a[0]=100; a[1]=200; }
C.static final int[] a = new int[2]{ 100,200 };
D.static final int[] a; static void init() { a = new int[3]; a[0]=100; a[1]=200; }

4.单项选择题

Click the Exhibit button.

What is the result?()

A.Line 26 prints "a" to System.out.
B.Line 26 prints "b" to System.out.
C.An exception is thrown at line 26 at runtime.
D.Compilation of class A will fail due to an error in line 6.

5.多项选择题

Given.

Which two statements are true?()

A.Foo.beta() is a valid invocation of beta().
B.Foo.alpha() is a valid invocation of alpha().
C.Method beta() can directly call method alpha().
D.Method alpha() can directly call method beta().

6.单项选择题

Given:

What is the result when the programmer attempts to compile the code and run it with the command java Converter 12?()

A.It is true that j==i.
B.It is false that j==i.
C.An exception is thrown at runtime.
D.Compilation fails because of an error in line 13.

7.单项选择题

Given:

What is the result?()

A.true true
B.false true
C.true false
D.false false

8.单项选择题

Given:

What creates the appropriate DateFormat object and adds a day to the Date object?()

A.35. DateFormat df = DateFormat.getDateFormat();42. d.setTime( (60 * 60 * 24) + d.getTime());
B.35. DateFormat df = DateFormat.getDateInstance();42. d.setTime( (1000 * 60 * 60 * 24) + d.getTime());
C.35. DateFormat df = DateFormat.getDateFormat();42. d.setLocalTime( (1000*60*60*24) + d.getLocalTime());
D.35. DateFormat df = DateFormat.getDateInstance();42. d.setLocalTime( (60 * 60 * 24) + d.getLocalTime());

10.多项选择题Given that c is a reference to a valid java.io.Console object,which two code fragments read a line of textfrom the console?()

A.String s = c.readLine();
B.char[] c = c.readLine();
C.String s = c.readConsole();
D.char[] c = c.readConsole();
E.String s = c.readLine("%s", "name ");

最新试题

Given a method that must ensure that its parameter is not null:What, inserted at line 12, is the appropriate way to handle a null value?()

题型:单项选择题

Given:What is the result?()

题型:单项选择题

Given:Which command-line invocations will compile?()

题型:单项选择题

Given:What is the result?()

题型:单项选择题

Given:When the doSomething method is called, after which line does the Object created in line 5 become available for garbage collection?()

题型:单项选择题

Given:What is the result?()

题型:单项选择题

Given:Which code, inserted at line 16, correctly retrieves a local instance of a Point object?()

题型:单项选择题

Click the Exhibit button.Which statement is true about the set variable on line 12?()

题型:单项选择题

Given:Which code fragment, inserted at the end of line 12, produces the output p is 420?()

题型:单项选择题

Given a correctly compiled class whose source code is:Assume that the class file is located in /foo/com/sun/sjcp/, the current directory is /foo/, and that theclasspath contains "." (current directory).Which command line correctly runs Commander?()

题型:单项选择题