Gọi đệ quy hàm main

public class FunctionCallMain {
    private static int a = 0;
    public static void main(String[] args) {
        if (a == 2)
            System.exit(0);
        else ++a;
        System.out.println("This is main");
        callMain();
        
    }
    
    public static void callMain() {
        System.out.println("This is a function call main function");
        main(new String[]{"Son"});
    }
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: