how to quit an application in java code example Example 1: java close application System.exit(0); Example 2: java quit application System.exit(n);