2011年JAVA认证模拟题(47)
Q139 What is the output displayed by the following program?class Question {
public static void main (String[] args)
{
String s1 = “ab”;
String s2 = “abcd”;
String s3 = “cd”
String s4 = s1 + s3;
s1 = s4;
System.out.print(“s1 “ + (( s1== s2) ?
“==” : “!=”) + “ s2”);
}
}
A s1 == s2
B s1 != s2
C s1
D s1 == “abcd”
Q140 Which of the following are true about constructors?
A A class inherits its constructors from its parent.
B The compiler supplies a default constructor if no constructors are
provided for a class.
C All constructors have a void return type.
D A constructor may throw an exception.
Q141 Which of the following are primitive types?
A byte
B String
C integer
D Float
Q139 B
Q140 BD
Q141 A
页:
[1]