Given:
Which three code fragments, inserted independently at line 6, will compile?()
A.list.add("foo");
B.Object o = list;
C.String s = list.get(0);
D.list = new ArrayList
您可能感兴趣的试卷
你可能感兴趣的试题
Given:
Which two, inserted at line 11, will allow the code to compile?()
A.public&ensp;class&ensp;MinMax<;?>;&ensp;{
B.public&ensp;class&ensp;MinMax<;?extends&ensp;Number>;&ensp;{
C.public&ensp;class&ensp;MinMax<;Nextends&ensp;Object>;&ensp;{
D.public&ensp;class&ensp;MinMax<;Nextends&ensp;Number>;&ensp;{
E.public&ensp;class&ensp;MinMax<;?extends&ensp;Object>;&ensp;{
F.public&ensp;class&ensp;MinMax<;Nextends&ensp;Integer>;&ensp;{
Given:
What is the result?()
A.0
B.1
C.2
D.3
E.4
Given:
Which three are true?()
A.Cat is-a Animal
B.Cat is-a Jumper
C.Dog is-a Animal
D.Dog is-a Jumper
E.Cat has-a Animal
F.Beagle has-a Tail
Given:
Which two are true?()
A.The output is mm.
B.The output is mc.
C.Component is-a Meter.
D.Component has-a Meter.
E.DeluxeThingy is-a Component.
F.DeluxeThingy has-a Component.
Given:
class ClassA {}
class ClassB extends ClassA {}
class ClassC extends ClassA {}
and:
ClassA p0 = new ClassA();
ClassB p1 = new ClassB();
ClassC p2 = new ClassC();
ClassA p3 = new ClassB();
ClassA p4 = new ClassC();
Which three are valid?()
A.p0 = p1;
B.p1 = p2;
C.p2 = p4;
D.p2 = (ClassC)p1;
E.p1 = (ClassB)p3;
F.p2 = (ClassC)p4;
Given:
Which statement is true?()
A.420 is the output.
B.An exception is thrown at runtime.
C.All constructors must be declared public.
D.Constructors CANNOT use the private modifier.
E.Constructors CANNOT use the protected modifier.
Given:
What is the result?()
A.b 3
B.b 8
C.b 13
D.f 3
Given:
What is the result?()
A.12
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.
A company has a business application that provides its users with many different reports:
receivables reports, payables reports, revenue projects, and so on. The company has just purchased somenew, state-of-the-art, wireless printers, and a programmer has been assigned the task of enhancing all ofthe reports to use not only the company’s old printers, but the new wireless printers as well. When the programmer starts looking into the application, the programmer discovers that because of the design of theapplication, it is necessary to make changes to each report to support the new printers.
Which two designconcepts most likely explain this situation? ()
A.Inheritance
B.Low cohesion
C.Tight coupling
D.High cohesion
E.Loose coupling
F.Object immutability
最新试题
Given a class whose instances, when found in a collection of objects, are sorted by using the compare To method, which two statements are true?()
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?()
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:Which command-line invocations will compile?()
Given:Which two code fragments, inserted independently at line 5, will compile without warnings?()
Given:What is the result?()
A team of programmers is involved in reviewing a proposed design for a new utility class. After some discussion, they realize that the current design allows other classes to access methods in the utility class that should be accessible only to methods within the utility class itself.What design issue has the team discovered?()
Given:What is the appropriate definition of the hashCode method in class Person?()
Given:What is the result?()
Given:What is the result?()