单项选择题
Given the following code:
if (x>0) {
System.out.println("first");
}
else if (x>-3) {
System.out.println("second");
}
else {
System.out.println("third");
}
Which range of x value would print the string "second"?()
A. x > 0
B. x > -3
C. x <= -3
D. x <= 0 & x > -3
相关考题
-
单项选择题
Whichisthereturntypeofthemethodmain()?
A. int
B. void
C. boolean
D. static -
多项选择题
1)classPerson{2)publicvoidprintValue(inti,intj){/*…*/}3)publicvoidprintValue(inti){/*...*/}4)}5)publicclassTeacherextendsPerson{6)publicvoidprintValue(){/*...*/}7)publicvoidprintValue(inti){/*...*/}8)publicstaticvoidmain(Stringargs[]){9)Persont=newTeacher();10)t.printValue(10);11)}12)}Whichmethodwillthestatementonline10call?()
A. on line 2
B. on line 3
C. on line 6
D. on line 7 -
多项选择题
Whichofthefollowingstatementsaretrue?()
A. The equals() method determines if reference values refer to the same object.
B. The == operator determines if the contents and type of two separate objects match.
C. The equals() method returns true only when the contents of two objects match.
D. The class File overrides equals() to return true if the contents and type of two separate objects match.
