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
正确答案:C
答案解析:有
微信扫一扫手机做题