0

Someone here suggested using the latter. I'm a newbie in java, just wondering.. what's the difference between the two?

Thanks in advance.

Karlo Kokkak
  • 3,674
  • 4
  • 18
  • 33
  • 1
    You can very well google it, why do you want to post it here anyways? – Suresh Feb 09 '18 at 11:06
  • System.exit(system call) terminates the currently running Java virtual machine by initiating its shutdown sequence. The argument serves as a status code. By convention, a nonzero status code indicates abnormal termination. On Unix and Linux systems, 0 for successful executions and 1 or higher for failed executions – Bipil Raut Feb 09 '18 at 11:51

1 Answers1

3

Calling System.exit(...) terminates the JVM, stopping everything immediately.

Platform.exit() just signals the JavaFX Toolkit to shut down, so the application instance stop().

Ivan Aracki
  • 4,861
  • 11
  • 59
  • 73
J_P
  • 761
  • 8
  • 17