问题:单选题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. 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 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.
问题:单选题Given: What is the output?()A42B420C462D42042ECompilation fails.FAn exception is thrown at runtime.
问题:多选题Given: Which two code fragments, inserted independently at line 13, will compile?()Asuper(name, baseSalary);Bthis.commission = commission;Csuper();this.commission = commission;Dthis.commission = commission;super();E super(name, baseSalary);this.commission = commission;Fthis.commission = commission;super(name, baseSalary);Gsuper(name, baseSalary, commission);
问题:单选题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
问题:单选题Which Man class properly represents the relationship "Man has a best friend who is a Dog"?()A class Man extends Dog { }B class Man implements Dog { }C class Man { private BestFriend dog; }D class Man { private Dog bestFriend; }E class Man { private Dog<bestFriend>; }F class Man { private BestFriend<dog>; }
问题:多选题A company has a business application that provides its users with many different reports: receivables reports, payables reports, revenue projects, and so on. The company has just purchased some new, state-of-the-art, wireless printers, and a programmer has been assigned the task of enhancing all of the reports to use not only the company's old printers, but the new wireless printers as well. When the programmer starts looking into the application, the programmer discovers that because of the design of the application, it is necessary to make changes to each report to support the new printers. Which two design concepts most likely explain this situation?()AInheritanceBLow cohesionCTight couplingDHigh cohesionELoose couplingFObject immutability
问题:单选题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: What is the result?()A1B2C12DCompilation fails.ENo output is produced.FAn exception is thrown at runtime.
问题:单选题Given: What is the result?()A2B24C234D246E2346FCompilation fails.
问题:多选题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 );
问题:单选题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?()ABBThe code runs with no output.CCompilation fails because of an error in line 12.DCompilation fails because of an error in line 15.ECompilation fails because of an error in line 18.
问题:多选题Given: Which three are valid?()Ap0 = p1;Bp1 = p2;Cp2 = p4;Dp2 = (ClassC)p1;Ep1 = (ClassB)p3;Fp2 = (ClassC)p4;
问题:单选题Given: What is the result?()Aw-fBf-p w-fCw-f b-fDf-p w-f b-fECompilation fails.FAn exception is thrown at runtime.