//switch语句中判断表达式类型为int,因此传递给switch和case语句的参数类型必须低于int类型(int、short、char、byte),但long类型不可以,string类型也不可以
//同一个switch语句,case的常量值必须互不相同
//switch语句中表达式的值必须是整型、字符型、字符串类型
public class Compound {
public static void main(String[] args){
int x=20;
{
int y=40;
System.out.println(y);
int z=245;
boolean b;
{
b=y>z;
System.out.println(b);
}
}
String world="hello world";
System.out.println(world);
}
}
运行结果