Difference between System.exit(0); and Platform.exit();?

1.1k views Asked by At

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

Thanks in advance.

1

There are 1 answers

0
J_P On BEST ANSWER

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

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