posted 20 years ago
Yes, System.exit(0) would end the program. But...
I wouldn't make 2 the default case. If you want the user to exit when explicitly selecting '2', then making all but '1' the default case would mean the program would exit if the user selected '3', or '4', or any value other than '1', which seems to go against what you wanted to do.
Anywho, that's my last 2 cents for today.
Give a man a fish, he'll eat for one day. Teach a man to fish, he'll drink all your beer.
Cheers, Jeff (SCJP 1.4 all those years ago...)