單項(xiàng)選擇題

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

微信掃碼免費(fèi)搜題