black

SCJP程序员认证考试

登录

单项选择题

Given the following code fragment:     
1) String str = null; 
2) if ((str != null) && (str.length() > 10)) {    
3) System.out.println("more than 10");    
4) } 
5) else if ((str != null) & (str.length() < 5)) {    
6) System.out.println("less than 5");    
7) } 
8) else { System.out.println("end"); }  
Which line will cause error?()    

A. line 1
B. line 2
C. line 5
D. line 8

相关考题

单项选择题 Aclassdesignrequiresthatamembervariablecannotbeaccessibledirectlyoutsidetheclass.Whichmodifiershouldbeusedtoobtaintheaccesscontrol?()

多项选择题 Whichofthefollowingstatementsaboutvariablesandscopearetrue?()

单项选择题 Given the following code:     1) public void modify() {     2) int i, j, k;     3) i = 100;     4) while ( i > 0 ) {     5) j = i * 2;  6) System.out.println (" The value of j is " + j );     7) k = k + 1;     8) i--;     9) }  10) }  Which line might cause an error during compilation?()

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

备案号:湘ICP备2022003000号-3