单项选择题

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();


您可能感兴趣的试卷

你可能感兴趣的试题

1.单项选择题

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.

2.单项选择题

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;}}

4.单项选择题

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.

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;

7.单项选择题

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.

8.单项选择题

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;

10.单项选择题A class games.cards.Poker is correctly defined in the jar file Poker.jar. A user wants to execute the main method of Poker on a UNIX system using the command: java games.cards.Poker What allows the user to do this?()

A.put Poker.jar in directory /stuff/java,and set the CLASSPATH to include /stuff/java
B.put Poker.jar in directory /stuff/java,and set the CLASSPATH to include /stuff/java/*.jar
C.Put Poker.jar in directory /stuff/java,and set the CLASSPATH to include /stuff/java/Poker.jar
D.put Poker.jar in directory /stuff/java/games/cards,and set the CLASSPATH to include /stuff/java
E.put Poker.jar in directory /stuff/java/games/cards,and set the CLASSPATH to include /stuff/java/*.jar
F.put Poker.jar in directory /stuff/java/games/cards,and set the CLASSPATH to include /stuff/java/Poker.jar

最新试题

Given that Triangle implements Runnable, and:Which two statements, inserted independently at both lines 35 and 41, tend to allow both threads to temporarily pause and allow the other thread to execute?()

题型:多项选择题

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?()

题型:单项选择题

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 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?()

题型:多项选择题

What is the result?()

题型:单项选择题

What is the result?()

题型:单项选择题

A programmer iterates over the TreeSet and prints the name of each Drink object.  What is the result?()

题型:单项选择题

Which statement is true?()

题型:单项选择题

What is the result?()

题型:单项选择题