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,632
  • 4
  • 17
  • 31
  • 1
    You can very well google it, why do you want to post it here anyways? – mannedear 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,265
  • 11
  • 55
  • 66
J_P
  • 751
  • 8
  • 17