问题:单选题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;
Monday, March 4, 2024
问题:单选题Given classes defined in two different files:What is required at line 5 in class SomeApp to use the process method of BitUtils?()Aprocess(bytes);BBitUtils.process(bytes);Cutil.BitUtils.process(bytes);DSomeApp cannot use methods in BitUtils.Eimport util.BitUtils.*; process(bytes);
问题:多选题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 );
Sunday, December 10, 2023
问题:单选题Given: What is the result?()AThe code runs with no output.BAn exception is thrown at runtime.CCompilation fails because of an error in line 20.DCompilation fails because of an error in line 21.ECompilation fails because of an error in line 23.FCompilation fails because of an error in line 25.
Thursday, January 11, 2024
问题:多选题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().
Tuesday, November 14, 2023
问题:单选题Given: Which statement is true?()ACompilation succeeds.BClass A does not compile.CThe method declared on line 9 cannot be modified to throw TestException.DTestA compiles if line 10 is enclosed in a try/catch block that catches TestException.
问题:单选题Given: Which is true?()AIf line 10 is removed, the compilation succeeds.BIf line 11 is removed, the compilation succeeds.CIf line 12 is removed, the compilation succeeds.DIf line 13 is removed, the compilation succeeds.EMore than one line must be removed for compilation to succeed.
问题:单选题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?()ACanadaBnull CanadaCCanada nullDCanada CanadaECompilation fails due to an error on line 26.FCompilation fails due to an error on line 29.
Thursday, November 9, 2023
问题:单选题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.
问题:单选题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
Wednesday, January 3, 2024
问题:单选题Given: What is the result?()ACompilation fails.BAn exception is thrown at runtime.CThe code executes normally and prints "bar".DThe 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?()ALine 5BLine 6CLine 7DLine 8ELine 9FLine 10
问题:单选题Given: What is the result?()A2B24C234D246E2346FCompilation fails.
问题:单选题Given: What is the result?()A1B2C12DCompilation fails.ENo output is produced.FAn exception is thrown at runtime.
问题:单选题Given: What is the output?()A42B420C462D42042ECompilation fails.FAn exception is thrown at runtime.