单项选择题
Given:
What is the result?()
A.12
B.The code runs with no output.
C.An exception is thrown at runtime.
D.Compilation fails because of an error in line 21.
E.Compilation fails because of an error in line 22.
F.Compilation fails because of an error in line 31.
相关考题
-
多项选择题
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 somenew, state-of-the-art, wireless printers, and a programmer has been assigned the task of enhancing all ofthe 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 theapplication, it is necessary to make changes to each report to support the new printers. Which two designconcepts most likely explain this situation? ()
A.Inheritance
B.Low cohesion
C.Tight coupling
D.High cohesion
E.Loose coupling
F.Object immutability -
单项选择题
Given: String[] elements = { "for", "tea", "too" }; String first = (elements.length > 0) ? elements[0] : null; What is the result?()
A.Compilation fails.
B.An exception is thrown at runtime.
C.The variable first is set to null.
D.The variable first is set to elements[0]. -
单项选择题
Given two files, GrizzlyBear.java and Salmon.java: If both classes are in the correct directories for their packages,and the Mammal class correctly defines thefindSalmon() method, which change allows this code to compile?()
A.add import animals.mammals.*; at line 2 in Salmon.java
B.add import animals.fish.*; at line 2 in GrizzlyBear.java
C.add import animals.fish.Salmon.*; at line 2 in GrizzlyBear.java
D.add import animals.mammals.GrizzlyBear.*; at line 2 in Salmon.java B
