class Test {
    void method2() {
        System.out.println("This is outer class method");
    }
    static class M2 {
        void method1() {
            System.out.println("This is method1 in class m2");
        }
    }
    public static void main(String[] args){
        //test a=new test();
        //a.method2();
    }
}
我想从主类调用 M2 类中的方法 1。还有method1中的method2。