how to terminate the program in java code example Example: how to exit a java program System.exit(0);