问题:单选题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;
查看答案
问题:单选题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?()ACompilation fails.BAn exception is thrown at runtime.CThe code executes normally and prints "bar".DThe code executes normally, but nothing prints.
问题:单选题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?()ACompilation fails.BAn exception is thrown at runtime.C[608, 609, 610, 612] [608, 610]D[608, 609, 610, 612] [608, 609, 610]E[606, 608, 609, 610, 612] [608, 610]F[606, 608, 609, 610, 612] [608, 609, 610]
问题:单选题Given: What is the result?()AHelloBHello WorldCCompilation fails.DHello World 5EThe code runs with no output.FAn exception is thrown at runtime.
问题:单选题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.
问题:多选题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 result when method testIfA is invoked?()ATrueBNot trueCAn exception is thrown at runtime.DCompilation fails because of an error at line 12.ECompilation fails because of an error at line 19.
问题:单选题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 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
问题:单选题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[/.]+";
问题:单选题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: What is the result?()A1B2C12DCompilation fails.ENo output is produced.FAn exception is thrown at runtime.
问题:单选题Given: What is the result?()A2B24C234D246E2346FCompilation fails.
问题:单选题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();