标签:path 没有初始化 字节 载器 pat jre cep 目录 style
1 public class Sample { 2 private static int a = 1; 3 public static long b; 4 public static long c; 5 6 static { 7 b = 2; 8 } 9 } 10
1 public class MyTest5 { 2 3 public static void main(String[] args) { 4 System.out.println(classChild5.c); 5 } 6 7 } 8 9 interface interfaceParent5 { 10 11 Thread thread = new Thread() { 12 13 { 14 System.out.println("interfaceParent5"); 15 } 16 }; 17 18 } 19 20 class classParent5 { 21 22 static { 23 System.out.println("classParent5"); 24 } 25 } 26 27 class classChild5 extends classParent5 implements interfaceParent5 { 28 29 30 public static int c = 6; 31 32 static { 33 System.out.println("classChild5"); 34 } 35 36 } 37 38 /* 39 * 输出: 40 * classParent5 41 * classChild5 42 * 6 43 * */
1 public class MyTest5 { 2 3 public static void main(String[] args) { 4 System.out.println(interfaceChild5.i); 5 } 6 7 } 8 9 interface interfaceParent5 { 10 11 Thread thread = new Thread() { 12 13 { 14 System.out.println("interfaceParent5"); 15 } 16 }; 17 18 } 19 20 class classParent5 { 21 22 static { 23 System.out.println("classParent5"); 24 } 25 } 26 27 28 interface interfaceChild5 extends interfaceParent5{ 29 30 int[] i = new int[]{1,2,3,4,5}; 31 32 classParent5 cp = new classParent5(); 33 34 } 35 /* 36 * 输出: 37 * classParent5 38 * [I@1540e19d 39 * */
标签:path 没有初始化 字节 载器 pat jre cep 目录 style
原文地址:https://www.cnblogs.com/zhihaospace/p/12293631.html