[Solved] What is the correct format for the System.exit() method? [closed]


System.exit(int) takes an integer argument, but otherwise you can call it to terminate your program.

Why do you want to call your main() method again? It is normally the static entry point to your program. If there’s some code you wish to repeat, I’d suggest putting this in its own method and calling that (from main() and your code in the question).

solved What is the correct format for the System.exit() method? [closed]