[Java] Recursive call in the main Java
Unexpectedly, when a friend gave this code and the test was run.
package VietSource.net.temp;
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[]{"Quan"});
}
}



Recent Comments