站内搜索
1z0-851 问题列表
问题
单选题Given the following directory structure: bigProject |--source | |--Utils.java | |--classes |-- And the following command line invocation: javac -d classes source/Utils.java Assume the current directory is bigProject,what is 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 statements are true?()AIt is possible for more than two threads to deadlock at once.BThe JVM implementation guarantees that multiple threads cannot enter into a deadlocked state.CDeadlocked threads release once their sleep() method's sleep duration has expired.DDeadlocking can occur only when the wait(), notify(), and notifyAll() methods are used incorrectly.EIt is possible for a single-threaded application to deadlock if synchronized blocks are used incorrectly.FIf a piece of code is capable of deadlocking, you cannot eliminate the possibility of deadlocking by inserting invocations of Thread.yield().
问题
多选题Which three statements are true?()AA final method in class X can be abstract if and only if X is abstract.BA protected method in class X can be overridden by any subclass of X.CA private static method can be called only within other static methods in class X.DA non-static public final method in class X can be overridden in any subclass of X.EA public static method in class X can be called by a subclass of X without explicitly referencing the class X.FA method with the same signature as a private final method in class X can be implemented in a subclass of X.GA protected method in class X can be overridden by a subclass of X only if the subclass is in the same package as X.
问题
多选题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 some new, state-of-the-art, wireless printers, and a programmer has been assigned the task of enhancing all of the 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 the application, it is necessary to make changes to each report to support the new printers. Which two design concepts most likely explain this situation?()AInheritanceBLow cohesionCTight couplingDHigh cohesionELoose couplingFObject immutability
问题
单选题A UNIX user named Bob wants to replace his chess program with a new one, but he is not sure where theold one is installed. Bob is currently able to run a Java chess program starting from his home directory /home/bob using the command: java-classpath /test:/home/bob/downloads/*.jar games.Chess Bob'sCLASSPATH is set (at login time) to/usr/lib:/home/bob/classes:/opt/java/lib:/opt/java/lib/*.jar What is a possible location for the Chess.class file?()A
/test/Chess.classB
/home/bob/Chess.classC
/test/games/Chess.classD
/usr/lib/games/Chess.classE
/home/bob/games/Chess.classF
inside jarfile /opt/java/lib/Games.jar (with a correct manifest)G
inside jarfile /home/bob/downloads/Games.jar (with a correct manifest)
问题
单选题A UNIX user named Bob wants to replace his chess program with a new one, but he is not sure where theold one is installed. Bob is currently able to run a Java chess program starting from his home directory /home/bob using the command: java-classpath /test:/home/bob/downloads/*.jar games.Chess Bob'sCLASSPATH is set (at login time) to/usr/lib:/home/bob/classes:/opt/java/lib:/opt/java/lib/*.jar What is a possible location for the Chess.class file?()A
/test/Chess.classB
/home/bob/Chess.classC
/test/games/Chess.classD
/usr/lib/games/Chess.classE
/home/bob/games/Chess.classF
inside jarfile /opt/java/lib/Games.jar (with a correct manifest)G
inside jarfile /home/bob/downloads/Games.jar (with a correct manifest)
问题
单选题Given: What is the result?()A
Compilation fails.B
An exception is thrown at runtime.C
[608, 609, 610, 612] [608, 610]D
[608, 609, 610, 612] [608, 609, 610]E
[606, 608, 609, 610, 612] [608, 610]F
[606, 608, 609, 610, 612] [608, 609, 610]
问题
单选题Given: Which code, inserted at line 14, allows the Sprite class to compile?()A
Direction d = NORTH;B
Nav.Direction d = NORTH;C
Direction d = Direction.NORTH;D
Nav.Direction d = Nav.Direction.NORTH;
问题
多选题A developer is creating a class Book, that needs to access class Paper. The Paper class is deployed in a JAR named myLib.jar. Which three, taken independently, will allow the developer to use the Paper class while compiling the Book class?()AThe JAR file is located at $JAVA_HOME/jre/classes/myLib.jar.BThe JAR file is located at $JAVA_HOME/jre/lib/ext/myLib.jar..CThe JAR file is located at /foo/myLib.jar and a classpath environment variable is set that includes /foo/myLib.jar/Paper.class.DThe JAR file is located at /foo/myLib.jar and a classpath environment variable is set that includes /foo/myLib.jar.EThe JAR file is located at /foo/myLib.jar and the Book class is compiled using javac -cp /foo/myLib.jar/Paper Book.java.FThe JAR file is located at /foo/myLib.jar and the Book class is compiled using javac -d /foo/myLib.jar Book.javaGThe JAR file is located at /foo/myLib.jar and the Book class is compiled using javac -classpath /foo/myLib.jar Book.java
问题
单选题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: Which three methods, inserted individually at line 14, will correctly complete class Two?()Aint foo() { /* more code here */ }Bvoid foo() { /* more code here */ }Cpublic void foo() { /* more code here */ }Dprivate void foo() { /* more code here */ }Eprotected void foo() { /* more code here */ }
问题
多选题Which two statements are true?()AIt is possible for more than two threads to deadlock at once.BThe JVM implementation guarantees that multiple threads cannot enter into a deadlocked state.CDeadlocked threads release once their sleep() method's sleep duration has expired.DDeadlocking can occur only when the wait(), notify(), and notifyAll() methods are used incorrectly.EIt is possible for a single-threaded application to deadlock if synchronized blocks are used incorrectly.FIf a piece of code is capable of deadlocking, you cannot eliminate the possibility of deadlocking by inserting invocations of Thread.yield().
问题
单选题Click the Exhibit button. Given: ClassA a = new ClassA( ); a.methodA( ); What is the result? ()A
Compilation fails.B
ClassC is displayed.C
The code runs with no output.D
An exception is thrown at runtime.
问题
单选题Given: What is the result?()A
BB
B, followed by an Exception.C
Compilation fails due to an error on line 9.D
Compilation fails due to an error on line 14.E
An Exception is thrown with no other output.
问题
多选题Given: Which two methods, inserted independently at line 17, correctly complete the Sales class?()Adouble getSalesAmount() { return 1230.45; }Bpublic double getSalesAmount() { return 1230.45; }Cprivate double getSalesAmount() { return 1230.45; }Dprotected double getSalesAmount() { return 1230.45; }