站内搜索
1z0-851 问题列表
问题 单选题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?()A Tight couplingB Low cohesionC High cohesionD Loose couplingE Weak encapsulationF Strong encapsulation

问题 单选题Given: What is the result?()A BB The code runs with no output.C Compilation fails because of an error in line 12.D Compilation fails because of an error in line 15.E Compilation fails because of an error in line 18.

问题 单选题A company that makes Computer Assisted Design (CAD) software has, within its application, some utility classes that are used to perform 3D rendering tasks. The company's chief scientist has just improved the performance of one of the utility classes' key rendering algorithms, and has assigned a programmer to replace the old algorithm with the new algorithm. When the programmer begins researching the utility classes, she is happy to discover that the algorithm to be replaced exists in only one class. The programmer reviews that class's API, and replaces the old algorithm with the new algorithm, being careful that her changes adhere strictly to the class's API. Once testing has begun, the programmer discovers that other classes that use the class she changed are no longer working properly. What design flaw is most likely the cause of these new bugs?()A InheritanceB Tight couplingC Low cohesionD High cohesionE Loose couplingF Object immutability

问题 单选题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;

问题 单选题Given: What is the result?()A The code runs with no output.B An exception is thrown at runtime.C Compilation fails because of an error in line 20.D Compilation fails because of an error in line 21.E Compilation fails because of an error in line 23.F Compilation fails because of an error in line 25.

问题 多选题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 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 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 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.

问题 单选题Given: Which is true?()A If line 10 is removed, the compilation succeeds.B If line 11 is removed, the compilation succeeds.C If line 12 is removed, the compilation succeeds.D If line 13 is removed, the compilation succeeds.E More than one line must be removed for compilation to succeed.

问题 单选题Given: Which regular expression, inserted at line 12, correctly splits test into "Test A", "Test B", and "Test C"?()A String regex="";B String regex=" .";C String regex=".*";D String regex="//s";E String regex="//.//s*";F String regex="//w[/.]+";

问题 多选题Click the Exhibit button. Given: Which two statements are true if a NullPointerException is thrown on line 3 of class C? ()AThe application will crash.BThe code on line 29 will be executed.CThe code on line 5 of class A will execute.DThe code on line 5 of class B will execute.EThe exception will be propagated back to line 27.

问题 单选题Given: Which statement is true?()A Compilation succeeds.B Class A does not compile.C The method declared on line 9 cannot be modified to throw TestException.D TestA compiles if line 10 is enclosed in a try/catch block that catches TestException.

问题 单选题Given: What is the result?()A 7B 49C 343D Compilation fails.E An exception is thrown at runtime.

问题 多选题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