title: Calling function when program exits in java
body: <p>I would like to save the programs settings every time the user exits the program. So I need a way to call a function when the user quits the program. How do I do that?</p>
  
  <p>I am using Java 1.5.</p>