public class Demo{
public static void main(String[] args){
new A();
}
}
public class Demo {
{
System.out.println("构造代码块");
}
public static void main(String[] args) {
{
System.out.println("普通代码块");
}
Demo demo = new Demo();
}
}
局部内部类中访问局部变量,局部变量需要被final修饰
A. private class A{ public A getA(){ return new A(); } }
B. private abstract class A{ public abstact void method(); }
C. public abstract class A{ public static abstract void method(); }
D. public abstract class A{ public abstract final void method(); }
E. public interface Demo { public void method(); }
F. public interface Demo { private static final String s = “a”; }