package J20250716.demo05_codeblocks; /** * @author WanJl * @version 1.0 * @title Demo01 * @description 局部代码块 * @create 2025/7/16 */ public class Demo01 { public static void main(String[] args) { { int a=10; System.out.println(a); } //在main方法运行结束之前,代码块里面的内容就已经运行完了,并且结束和释放了。 //System.out.println(a); } }