dispose是java.awt.Window.包里面的,而exit是java.lang包里面的,下面的是这两个API的说明,自个看看。dispose
public void dispose()
Releases all of the native screen resources used by this Window, its subcomponents, and all of its owned children. That is, the resources for these Components will be destroyed, any memory they consume will be returned to the OS, and they will be ed as undisplayable. 
The Window and its subcomponents can be made displayable again by rebuilding the native resources with a subsequent call to pack or show. The states of the recreated Window and its subcomponents will be identical to the states of these objects at the point where the Window was disposed (not accounting for additional modifcations between those actions). 
See Also:
Component.isDisplayable(), pack(), show()exit
public static void exit(int status)
Terminates the currently running Java Virtual Machine. The argument serves as a status code; by convention, a nonzero status code indicates abnormal termination. 
This method calls the exit method in class Runtime. This method never returns normally. The call System.exit(n) is effectively equivalent to the call:  Runtime.getRuntime().exit(n)
 Parameters:
status - exit status. 
Throws: 
SecurityException - if a security manager exists and its checkExit method doesn't allow exit with the specified status.
See Also:
Runtime.exit(int)