black

SCJP程序员认证考试

登录

单项选择题

public class Test { 
public static void main(String [] args) { 
int x =5; 
boolean b1 = true; 
boolean b2 = false; 
if((x==4) && !b2) 
System.out.print(”l “); 
System.out.print(”2 “); 
if ((b2 = true) && b1) 
System.out.print(”3 “); 
}
} 
What is the result?() 

A. 2
B. 3
C. 1 2
D. 2 3
E. 1 2 3
F. Compilation fails.
G. Au exceptional is thrown at runtime.

相关考题

多项选择题 10. public class Bar {  11.static void foo(int...x) {  12. // insert code here  13. }  14. }  Which two code fragments, inserted independently at line 12, will allow the class to compile?()

多项选择题 11. public interface Status {  12. /* insert code here */ int MY_VALUE = 10;  13. }  Which three are valid on line 12?()

单项选择题 Given the following code:     1) class Parent {     2) private String name;     3) public Parent(){}     4) }  5) public class Child extends Parent {     6) private String department;  7) public Child() {}  8) public String getValue(){ return name; }     9) public static void main(String arg[]) {     10) Parent p = new Parent();     11) }  12) }  Which line will cause error?()

All Rights Reserved 版权所有©易学考试网(yxkao.com)

备案号:湘ICP备2022003000号-3