A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

(a)      

int i=0;

if(i)

{

  System.out.println("hello");

}

(b)      

boolean b1=true;

boolean b2=true;

if(b1==b2)

{

  System.out.println("So true");

}

(c)      

int i=1;

int j=2;

if(i==1||j==i)

{

  System.out.println("ok");

}

(d)      

int i=1;

int j=2;

if(i==1&|j==i)

{

  System.out.println("ok");


1 个回复

倒序浏览
b,c可以编译通过
a.
if()括号中只能是布尔值
d.
好像少了一个大括号
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 加入黑马