java - Using System.exit() to call another method within the same class -


is there reason why should avoid calling methods in system.exit() in example code below?

public class rbs {      int processclients() {         ...         return 0;     }      public static void main(string[] args) {         rbs mybank = new rbs("royal bank of scotland");         system.exit(mybank.processclients());     } } 

the java.lang.system.exit() method terminates running java virtual machine.

the declaration java.lang.system.exit() method

public static void exit(int status)//should int value.  

where status -- exit status.

here using value of method means mybank.processclients(). exit value return value 0 of above method

for more


Comments