标签:
1 class A{ 2 static{System.out.println("Class A");} 3 {System.out.println("Class c");} 4 public A(){ 5 System.out.println("this class A"); 6 } 7 } 8 9 public class Test1 extends A{ 10 static {System.out.println("class B");} 11 public Test1(){ 12 System.out.println("this class B"); 13 } 14 {System.out.println("class d");} 15 public static void main(String[] args) { 16 System.out.println("----start ---"); 17 new Test1(); 18 new Test1(); 19 System.out.println("---end---"); 20 } 21 } 22 23 结果为: 24 Class A 25 class B 26 ----start --- 27 Class c 28 this class A 29 class d 30 this class B 31 Class c 32 this class A 33 class d 34 this class B 35 ---end---
****
赋值步骤为
标签:
原文地址:http://www.cnblogs.com/hupi/p/5223621.html