问题:单选题A programmer has an algorithm that requires a java.util.List that provides an efficient implementation of add(0, object), but does NOT need to support quick random access. What supports these requirements?()A java.util.QueueB java.util.ArrayListC java.util.LinearListD java.util.LinkedList
查看答案
问题:单选题Given that t1 is a reference to a live thread, which is true?()A The Thread.sleep() method can take t1 as an argument.B The Object.notify() method can take t1 as an argument.C The Thread.yield() method can take t1 as an argument.D The Thread.setPriority() method can take t1 as an argument.E The Object.notify() method arbitrarily chooses which thread to notify.
问题:单选题Given: What is the result?()AHelloBHello WorldCCompilation fails.DHello World 5EThe code runs with no output.FAn exception is thrown at runtime.
问题:单选题Click the Exhibit button. What is the output if the main( ) method is run?()A4B5C8D9ECompilation fails.FAn exception is thrown at runtime.GIt is impossible to determine for certain.
问题:多选题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 */ }
问题:单选题Given: What is the result?()A1B2C12DCompilation fails.ENo output is produced.FAn exception is thrown at runtime.
问题:单选题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 output?()A42B420C462D42042ECompilation fails.FAn exception is thrown at runtime.
问题:单选题Given: What is the result?()A2B3C12D23E123FCompilation fails.GAn exception is thrown at runtime.
问题:多选题Click the Exhibit button. Which three code fragments, added individually at line 29, produce the output 100?()An = 100;Bi.setX( 100 );Co.getY().setX( 100 );Di = new Inner(); i.setX( 100 );Eo.setY( i ); i = new Inner(); i.setX( 100 );Fi = new Inner(); i.setX( 100 ); o.setY( i );
问题:单选题Given: Which code, inserted at line 14, allows the Sprite class to compile?()ADirection d = NORTH;BNav.Direction d = NORTH;CDirection d = Direction.NORTH;DNav.Direction d = Nav.Direction.NORTH;
问题:多选题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; }
问题:单选题Given: What is the result when the go( ) method is invoked?()A00B0001C000120D00012021ECompilation fails.FAn exception is thrown at runtime.
问题:单选题Given: What is the result?()A2B24C234D246E2346FCompilation fails.
问题:多选题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
问题:单选题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