Given classes defined in two different files:
What is the result of executing XMLMessage.main?()
A.text
B.Compilation fails.
C.<msg>text</msg>
D.An exception is thrown at runtime.
您可能感兴趣的试卷
你可能感兴趣的试题
A.The JAR file is located at $JAVA_HOME/jre/classes/myLib.jar
B.The JAR file is located at $JAVA_HOME/jre/lib/ext/myLib.jar
C.The JAR file is located at /foo/myLib.jar and a classpath environment variable is set that includes /foo/myLib.jar/Paper.class
D.The JAR file is located at /foo/myLib.jar and a classpath environment variable is set that includes /foo/myLib.jar
E.The JAR file is located at /foo/myLib.jar and the Book class is compiled using javac –cp /foo/myLib.jar/Paper Book.java
F.The JAR file is located at foo/myLib.jar and the Book class is compiled using javac –classpath /foo/myLib.jar Book.java
What is the result?()
A.1,2,3
B.Compilation fails because of an error in line 12.
C.Compilation fails because of an error in line 13.
D.Compilation fails because of an error in line 14.
E.A ClassCastException is thrown at runtime.
What is the result?()
A.TestA
B.TestB
C.Compilation fails.
D.An exception is thrown at runtime.
What is the result?()
A.Compilation succeeds.
B.Exactly one class does NOT compile.
C.Exactly two classes do NOT compile.
D.Exactly four classes do NOT compile.
E.Exactly three classes do NOT compile.
Which two classes correctly implement both the java.lang.Runnable and the java.lang.Cloneable interfaces?()
A.A
B.B
C.C
D.D
E.E
Which statement is true about the class of an object that can reference the variable base?()
A.It can be any class.
B.No class has access to base.
C.The class must belong to the geometry package.
D.The class must be a subclass of the class Hypotenuse.
What is the result?()
A.Compilation fails because of an error in line 3.
B.Compilation fails because of an error in line 7.
C.Compilation fails because of an error in line 9.
D.If you define D e = new E(),then e.bMethod() invokes the version of bMethod() defined in Line 5.
E.If you define D e = (D)(new E()),then e.bMethod() invokes the version of bMethod() defined in Line 5.
F.If you define D e = (D)(new E()),then e.bMethod() invokes the version of bMethod() defined in Line 9.
Which three are valid on line 12?()
A.final
B.static
C.native
D.public
E.private
F.abstract
G.protected
A.1
B.2
C.3
D.4
E.5
Which two methods, inserted independently at line 17, correctly complete the Sales class?()
A.double getSalesAmount() { return 1230.45; }
B.public double getSalesAmount() { return 1230.45; }
C.private double getSalesAmount() { return 1230.45; }
D.protected double getSalesAmount() { return 1230.45; }
最新试题
What is the result?()
A programmer is developing a class Key, that will be used as a key in a standard java.util.HashMap. Which two methods should be overridden to assure that Key works correctly as a key?()
Which two of statements are true?()
Which statement is true?()
What is the result?()
What is the result?()
Which two statements are true?()
What is the result?()
Which code, inserted at line 4, guarantees that this program will output [1, 2]?()
Which two are possible results?()