问题:多选题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.
查看答案
问题:单选题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.
问题:多选题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().
问题:单选题Given: What is the result when the go( ) method is invoked?()A00B0001C000120D00012021ECompilation fails.FAn exception is thrown at runtime.
问题:单选题Given: What is the result?()AHelloBHello WorldCCompilation fails.DHello World 5EThe code runs with no output.FAn exception is thrown at runtime.
问题:单选题Given: What is the result?()ABBB, followed by an Exception.CCompilation fails due to an error on line 9.DCompilation fails due to an error on line 14.EAn Exception is thrown with no other output.
问题:多选题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 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: What is the result?()A1B2C12DCompilation fails.ENo output is produced.FAn exception is thrown at runtime.
问题:单选题Given: Which code, inserted at line 15, creates an instance of the Point class defined in Line?()APoint p = new Point();BLine.Point p = new Line.Point();CThe Point class cannot be instatiated at line 15.DLine l = new Line() ; l.Point p = new l.Point();
问题:单选题Given: What is the result?()A2B24C234D246E2346FCompilation fails.
问题:单选题Given: What is the output?()A42B420C462D42042ECompilation fails.FAn exception is thrown at runtime.
问题:单选题Given: Which regular expression, inserted at line 12, correctly splits test into "Test A", "Test B", and "Test C"?()AString regex="";BString regex=" .";CString regex=".*";DString regex="//s";EString regex="//.//s*";FString regex="//w[/.]+";
问题:单选题Click the Exhibit button. Which statement is true about the classes and interfaces in the exhibit?()ACompilation will succeed for all classes and interfaces.BCompilation of class C will fail because of an error in line 2.CCompilation of class C will fail because of an error in line 6.DCompilation of class AImpl will fail because of an error in line 2.
问题:多选题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: When the doSomething method is called, after which line does the Object created in line 5 become available for garbage collection?()ALine 5BLine 6CLine 7DLine 8ELine 9FLine 10