欢迎来到牛牛题库网 牛牛题库官网
logo

单项选择题

给定下面的代码,哪些行会导致错误?
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"); }

A.line 1
B.line 2
C.line 5
D.line 8
点击查看答案&解析
微信小程序免费搜题
微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题