What is the result?()
A.Compilation of class A fails.
B.Line 28 prints the value 3 to System.out.
C.Line 28 prints the value 1 to System.out.
D.A runtime error occurs when line 25 executes.
E.Compilation fails because of an error on line 28.
您可能感兴趣的试卷
你可能感兴趣的试题
Which code, inserted at line 15, creates an instance of the Point class defined in Line?()
A.Point p = new Point();
B.Line.Point p = new Line.Point();
C.The Point class cannot be instatiated at line 15.
D.Line l = new Line(); l.Point p = new l.Point();
What is the result?()
A.Mr. John Doe
B.An exception is thrown at runtime.
C.Compilation fails because of an error in line 12.
D.Compilation fails because of an error in line 15.
E.Compilation fails because of an error in line 20.
Which code, inserted at line 15, allows the class Sprite to compile?()
A.Foo{public int bar(){return 1;}}
B.new Foo{public int bar(){return 1;}}
C.new Foo(){public int bar(){return 1;}}
D.new class Foo{public int bar(){return 1;}}
Given:
package com.sun.scjp;
public class Geodetics {
public static final double DIAMETER = 12756.32; //kilometers
}
Which two correctly access the DIAMETER member of the Geodetics class?()
A.A
B.B
C.C
D.D
What is the result?()
A.12,4
B.The code runs with no output.
C.An exception is thrown at runtime.
D.Compilation fails because of an error in line 21.
E.Compilation fails because of an error in line 22.
F.Compilation fails because of an error in line 31.
When line 14 is reached, how many objects are eligible for the garbage collector?()
A.0
B.1
C.2
D.3
E.4
F.6
Which code should be inserted at line 1 of Demo.java to compile and run Demo toprint "pizzapizza"?()
A.import utils.*;
B.static import utils.*;
C.import utils.Repetition.*;
D.static import utils.Repetition.*;
E.import utils.Repetition.twice();
F.import static utils.Repetition.twice;
G.static import utils.Repetition.twice;
What is the result?()
A.test
B.null
C.An exception is thrown at runtime.
D.Compilation fails because of an error in line 1.
E.Compilation fails because of an error in line 4.
F.Compilation fails because of an error in line 5.
Which code, inserted at line 14, allows the Sprite class to compile?()
A.Direction d = NORTH;
B.Nav.Direction d = NORTH;
C.Direction d = Direction.NORTH;
D.Nav.Direction d = Nav.Direction.NORTH;
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 the classpath contains "." (current directory).
Which command line correctly runs Commander?()
A.java Commander
B.java com.sun.sjcp.Commander
C.java com/sun/sjcp/Commander
D.java -cp com.sun.sjcp Commander
E.java -cp com/sun/sjcp Commander
![](https://static.ppkao.com/ppmg/img/appqrcode.png)
最新试题
What is the result?()
Which two statements are true?()
Given: foo and bar are public references available to many other threads, foo refers to a Thread and bar is an Object. The thread foo is currently executing bar.wait(). From another thread, what provides the most reliable way to ensure that foo will stop executing wait()?()
A programmer must create a generic class MinMax and the type parameter of MinMax must implement Comparable. Which implementation of MinMax will compile?()
What is the result?()
What is the result?()
What is the result?()
What is the result?()
Which three changes should be made to adapt this class to be used safely by multiple threads?()
Which two of statements are true?()