本帖最后由 张鹏宇 于 2014-5-19 15:41 编辑
- class A{
- static{
- System.out.print("1");
- }
- public A(){
- System.out.print("2");
- }
- }
- class B extends A{
- static{
- System.out.print("a");
- }
- public B(){
- System.out.print("b");
- }
- }
- public class Hello{
- public static void main(String[] ars){
- A ab = new B();
- ab = new B();
- }
- }
复制代码 |
|