问题:单选题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 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: 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[/.]+";
问题:单选题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?()AHelloBHello WorldCCompilation fails.DHello World 5EThe code runs with no output.FAn exception is thrown at runtime.
问题:单选题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.
问题:多选题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.
问题:多选题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: What is the output?()A42B420C462D42042ECompilation fails.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.
问题:单选题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)
问题:多选题Which two scenarios are NOT safe to replace a StringBuffer object with a StringBuilder object?()AWhen using versions of Java technology earlier than 5.0.BWhen sharing a StringBuffer among multiple threads.CWhen using the java.io class StringBufferInputStream.DWhen you plan to reuse the StringBuffer to build more than one string.
问题:单选题Given: What is the result?()AcollieBharrierCCompilation fails.Dcollie harrierEAn exception is thrown at runtime.
问题:单选题Given: What is the result?()A2B24C234D246E2346FCompilation fails.