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; }
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.
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;
What is the result?()
A.b,3
B.b,8
C.b,13
D.f,3
E.f,8
F.f,13
G.Compilation fails.
H.An exception is thrown at runtime.
Given two files, GrizzlyBear.java and Salmon.java:
If both classes are in the correct directories for their packages, and the Mammal class correctly defines the findSalmon() method, which change allows this code to compile?()
A.add import animals. mammals.*; at line 2 in Salmon.java
B.add import animals.fish.*; at line 2 in GrizzlyBearjava
C.add import animals.fish.Salmon.*; at line 2 in GrizzlyBear.java
D.add import animals. mammals.GrizzlyBear*; at line 2 in Salmon.java
And MainClass exists in the /apps/com/company/application directory. Assume the CLASSPATH environment variable is set to "." (current directory).Which two java commands entered at the command line will run MainClass?()
A.java MainClass if run from the /apps directory
B.java com.company.application.MainClass if run from the /apps directory
C.java -classpath /apps com.company.application.MainClass if run from any directory
D.java-classpath . MainClass if run from the /apps/com/company/application directory
E.java -classpath /apps/com/company/application:. MainClass if run from the /apps directory
F.java com.company.application.MainClass if run from the /apps/com/company/application directory
Given the following directory structure:
And the following command line invocation:
javac –d classes source/Utils.java
Assume the current directory is bigProject, what it the result?()
A.If the compile is successful, Utils.class is added to the source directory.
B.The compiler returns an invalid flag error.
C.If the compile is successful, Utils.class is added to the classes directory.
D.If the compile is successful, Utils.class is added to the bigProject directory.
最新试题
Which two of statements are true?()
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()?()
What is the result?()
What is the appropriate definition of the hashCode method in class Person?()
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?()
Which two are possible results?()
Which statement is true about the set variable on line 12?()
A programmer iterates over the TreeSet and prints the name of each Drink object. What is the result?()
Which statement is true?()