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 code, inserted at line 16, will cause a java.lang.ClassCastException?()
A.Alpha a=x;
B.Foo f=(Delta)x;
C.Foo f=(Alpha)x;
D.Beta b=(Beta)(Alpha)x;
What is the result?()
A.Canada
B.null Canada
C.Canada null
D.Canada Canada
E.Compilation fails due to an error on line 26.
F.Compilation fails due to an error on line 29.
最新试题
Which two are possible results?()
Which three will compile and run without exception?()
What is the result?()
Given that t1 is a reference to a live thread, which is true?()
Which statement is true about the set variable on line 12?()
Which two can be results?()
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?()
A programmer iterates over the TreeSet and prints the name of each Drink object. What is the result?()
What is the result?()
What is the result?()