复合语句
主方法中定义了复合语句块,复合语句块中还可以包含另一符合语句块
/*复合语句
* 主方法中定义了复合语句块,复合语句块中还可以包含另一符合语句块*/
package LC;
public class Compound {
public static void main(String[] args) {
// TODO 自动生成的方法存根
int x = 20;
{
int y = 40; //复合语句
System.out.println(y);
int z = 245;
boolean b;
{
b= y > z; //复合语句
System.out.println(b);
}
}
String word = "Hello Java";
System.out.println(word);
}
}