stop a program from continuing in java code example Example: how to exit a java program System.exit(0);