Replaces System.exit() (deprecated) with Application.quit()