Created
May 13, 2011 11:39
-
-
Save googya/970385 to your computer and use it in GitHub Desktop.
静态与实例的区别
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class App { public App(String name) { System.out.println(name + "'s constructor called"); } static { System.out.println("static initializer called"); } { System.out.println("instance initializer called"); } static { System.out.println("static initializer2 called"); } { System.out.println("instance initializer2 called"); } public static void main( String[] args ) { new App("one"); new App("two"); } } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
class Example { public static void main(String[] args) { System.out.println("Hello World!"); http://Phi.Lho.free.fr System.exit(0); } } 这个居然是合法的。。。。