+ 2
What this statement do "system.exit(x)"?
I saw a question in which first a value is assigned to X and then come this statement "system.exit(x)" System.out.println(X)
2 odpowiedzi
+ 7
System.exit() method exits current program by terminating running Java virtual machine. This method takes a status code.
Here X is a status code.
If X = 0 means it will terminate successfully.
if X = 1 or -1 or any other non-zero value– Generally indicates unsuccessful termination
+ 1
Thanks