本帖最后由 周志伟 于 2013-4-7 20:57 编辑
- class StaticCode
- {
- static
- {
- System.out.println("a");
- }
- }
- class StaticCodeDemo
- {
- static
- {
- System.out.println("b");
- }
-
- public static void main(String[] args)
- {
- new StaticCode();//这里为什么不是StaticCode s1 = new StaticCode();?????????????????
- new StaticCode();//这里为什么不是StaticCode s2 = new StaticCode();?????????????????
- System.out.println("over");
- }
- static
- {
- System.out.println("c");
- }
- }
复制代码 |