📄 bool.java
字号:
import java.util.*;
public class Bool
{
public static void main(String[] args)
{
Random rand=new Random();
int i=rand.nextInt()%100;
int j=rand.nextInt()%100;
Prt("i:"+i);
Prt("j:"+j);
Prt("i>j is "+(i>j));
Prt("i<j is "+(i<j));
Prt("i>=j is "+(i>=j));
Prt("i<=j is "+(i<=j));
Prt("i==j is "+(i==j));
Prt("i!=j is "+(i!=j));
//Treating an int as a boolean is not legal java
Prt("(i<10)&&(j<10) is "+((i<10)&&(j<10)));
Prt("(i<10)||(j<10) is "+((i<10)||(j<10)));
}
static void Prt(String s)
{
System.out.println(s);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -