java68-局部内部类

public class test113 {
    public void method(){
         final int age =23;
        class Localinner{
            public void method(){
                System.out.println("歌谣");
                System.out.println(age);
            }
        }
        new Localinner().method();
    }
 
    
        public static void main(String[] args) {
                test113 o=new test113();
                o.method();
            }
        
运行结果

 

posted @ 2022-06-22 22:55  前端导师歌谣  阅读(19)  评论(0)    收藏  举报