how to add an option to quit while program is running java code example Example: java quit application System.exit(n);