为什么会出现这种问题,求各位大佬解答一下。
我跟着视频敲的,为什么出不来“true”?
package Text;
public class text01 {
public static void main(String[] args) {
// TODO Auto-generated method stub
/*
* Boolean 布尔值
* 布尔值只有两个
* true
* -表示真
* false
* -表示假
*/
var bool = true;
console.log(bool);
}
}
你确定这个代码是java吗?有视频的地址吗?
你这语法是java和js混搭的代码了,明显不对
System.out.println(bool);
在eclipse下面写的直接会报错吧?
你这是java和JavaScript混了。
试试这个:
public class test {
public static void main(String[] args) {
boolean A=true;
boolean B=false;
System.out.println(A);
System.out.println(B);
}
}
新手吧