Have a look at my code.
2nd version....
When you run a class file using JVM then JVM starts up and automatically shuts down when main method terminates. Here in both cases at line 4 the main method terminates. So here return & System.exit doing same thing?
Code:
clas MainClass{
public static void main(String a[]){
int a = 10;
if(a==10) System.exit(0);
}
}
Code:
clas MainClass{
public static void main(String a[]){
int a = 10;
if(a==10) return;
}
}
Comment