Given:
Which code, inserted at line 16, correctly retrieves a local instance of a Point object?()
A.Point p = Line.getPoint();
B.Line.Point p = Line.getPoint();
C.Point p = (new Line()).getPoint();
D.Line.Point p = (new Line()).getPoint();
您可能感兴趣的试卷
你可能感兴趣的试题
Given:
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.
Given:
Which two methods, inserted individually, correctly complete the Three class?()
A.public void foo() {}
B.public int foo() { return 3; }
C.public Two foo() { return this; }
D.public One foo() { return this; }
E.public Object foo() { return this; }
Given:
What is the result?()
A.3
B.23
C.32
D.123
E.321
Given:
What is the result?()
A.2
B.3
C.4
D.6
E.7
Given:
10.interface Data { public void load(); }
11.abstract class Info { public abstract void load(); }
Which class correctly uses the Data interface and Info class?()
A.
B.
C.
D.
Click the Exhibit button.
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.
Given:
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.
Given:
What is the result?()
A.Hello
B.Hello World
C.Compilation fails.
D.Hello World 5
E.The code runs with no output.
A.Has-a relationships should never be encapsulated.
B.Has-a relationships should be implemented using inheritance.
C.Has-a relationships can be implemented using instance variables.
D.Is-a relationships can be implemented using the extends keyword.
E.Is-a relationships can be implemented using the implements keyword.
F.An array or a collection can be used to implement a one-to-many has-a relationship.
Given:
Which four code fragments, inserted independently at line 7, will compile?()
A.public void m1() { }
B.protected void m1() { }
C.private void m1() { }
D.void m2() { }
E.public void m2() { }
F.protected void m2() { }
最新试题
Given:What is the result?()
Given:What is the result?()
Given:Which two code fragments, inserted independently at line 5, will compile without warnings?()
Click the Exhibit buttonWhich two statements are true if a NullPointerException is thrown on line 3 of class C?()
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?()
Click the Exhibit button.What two must the programmer do to correct the compilation errors?()
Given:What is the result?()
A programmer has an algorithm that requires a java.util.List that provides an efficient implementation of add(0, object), but does NOT need to support quick random access.What supports these requirements?()
Given:What is the result?()
Given:Which code fragment, inserted at the end of line 12, produces the output p is 420?()