Static块(静态代码块)
摘要:转自:http://www.cnblogs.com/o-andy-o/archive/2011/12/28/2304959.htmlStatic 块仅在该类被加载时执行一次class UseStatic { static int a = 3; static int b; static void meth(int x) { System.out.println("x = " + x); System.out.println("a = " + a); System.out.println("b = " + b); } static { S
阅读全文
posted @ 2012-08-07 14:38