Yep, if there is a particular point of the program where you would want to programmatically terminate the program, you would code:

System.exit(0);