单项选择题
try {
if ((new Object))(.equals((new Object()))) {
System.out.println(“equal”);
}else{
System.out.println(“not equal”);
}
}catch (Exception e) {
System.out.println(“exception”);
}
What is the result? ()
A. equal
B. not equal
C. exception
D. Compilation fails.
相关考题
-
单项选择题
public class Test { public static void main(String [] args) { System.out.println(args.length > 4 &&  args[4].equals(“-d”)); } } If the program is invoked using the command line: java Test One Two Three –d What is the result?()
A. true
B. false
C. Compilation fails.
D. An exception is thrown at runtime. -
多项选择题
Giventhatbandcrefertoinstancesofwrapperclasses,whichtwostatementsaretrue?()
A. b.equals(b) returns true.
B. b.equals(c) returns the same result as b == c.
C. b.eqials(c) can return false even if c.equals(b) returns true.
D. b.equals(c) throws an exception if b and c are different wrapper types.
E. b.equals(c) returns false if the type of wrapper objects being compared are different. -
单项选择题
String a = null; a.concat(“abc”); a.concat(“def”); System.out.println(a); What is the result?()
A. abc
B. null
C. abcdef
D. Compilation fails.
E. The code runs with no output.
F. An exception is thrown at runtime.
