站内搜索
1z0-851 问题列表
问题
单选题Given: What is the result?()A
Compilation fails.B
exception is thrown at runtime.C
The attribute id in the ItemTest object remains unchanged.D
The attribute id in the ItemTest object is modified to the new value.E
A new ItemTest object is created with the preferred value in the id attribute.
问题
多选题Given a class whose instances, when found in a collection of objects, are sorted by using the compareTo( )method, which two statements are true?()AThe class implements java.lang.Comparable.BThe class implements java.util.Comparator.CThe interface used to implement sorting allows this class to define only one sort sequence.DThe interface used to implement sorting allows this class to define many different sort sequences.
问题
单选题Given: What is the result when method testIfA is invoked?()A
TrueB
Not trueC
An exception is thrown at runtime.D
Compilation fails because of an error at line 12.E
Compilation fails because of an error at line 19.
问题
单选题Which Man class properly represents the relationship "Man has a best friend who is a Dog"?()A
class Man extends Dog { }B
class Man implements Dog { }C
class Man { private BestFriend dog; }D
class Man { private Dog bestFriend; }E
class Man { private DogbestFriend; }F
class Man { private BestFrienddog; }
问题
单选题Given: What is the result?()A
Compilation fails.B
An exception is thrown at runtime.C
The code executes normally and prints "bar".D
The code executes normally, but nothing prints.
问题
单选题Given: When the doSomething method is called, after which line does the Object created in line 5 become available for garbage collection?()A
Line 5B
Line 6C
Line 7D
Line 8E
Line 9F
Line 10
问题
多选题Given: Which two statements are true about the result if the default locale is Locale.US?()AThe value of b is 2.BThe value of a is 3.14.CThe value of b is 2.00.DThe value of a is 3.141.EThe value of a is 3.1415.FThe value of a is 3.1416.GThe value of b is 2.0000.
问题
单选题Given classes defined in two different files: What is required at line 5 in class SomeApp to use the process method of BitUtils?()A
process(bytes);B
BitUtils.process(bytes);C
app.BitUtils.process(bytes);D
util.BitUtils.process(bytes);E
import util.BitUtils.*; process(bytes);F
SomeApp cannot use the process method in BitUtils.
问题
单选题Given classes defined in two different files:What is required at line 5 in class SomeApp to use the process method of BitUtils?()A
process(bytes);B
BitUtils.process(bytes);C
util.BitUtils.process(bytes);D
SomeApp cannot use methods in BitUtils.E
import util.BitUtils.*; process(bytes);
问题
单选题A team of programmers is reviewing a proposed API for a new utility class. After some discussion,they realize that they can reduce the number of methods in the API without losing any functionality.If they implement the new design, which two OO principles will they be promoting?()A
Looser couplingB
Tighter couplingC
Lower cohesionD
Higher cohesionE
Weaker encapsulationF
Stronger encapsulation
问题
单选题Given: What is the result?()A
Afoo AfooB
Afoo BfooC
Bfoo AfooD
Bfoo BfooE
Compilation fails.F
An exception is thrown at runtime.
问题
单选题Given: What is the result?()A
collieB
harrierC
Compilation fails.D
collie harrierE
An exception is thrown at runtime.
问题
多选题Given: Which three are valid?()Ap0 = p1;Bp1 = p2;Cp2 = p4;Dp2 = (ClassC)p1;Ep1 = (ClassB)p3;Fp2 = (ClassC)p4;
问题
单选题Given: What is the result when the go( ) method is invoked?()A
00B
0001C
000120D
00012021E
Compilation fails.F
An exception is thrown at runtime.
问题
单选题Given: What is the result?()A
Compilation fails.B
An exception is thrown at runtime.C
The code executes normally and prints "sleep".D
The code executes normally, but nothing is printed.