1.boolean b=true;int i =(int)b;2.int i=1;boolean b=(boolean)i;
都不行,在idea运行中编译都通不过,具体报错截图如下所示
bool就两个值,int非零的都可以看成true
在java中不可以,在一些别的语言中可以