I'm junior Java Developper and I'm new to use IntelliJ IDEA. When an app ends or finishes it says Process finished with exit code 0 or 1, and sometimes -1, and I don't actually know the meaning of these codes. Thank you for telling me the difference between those numbers.
0 usually means the process terminated normally with no error condition. Other codes generally indicate a specific error condition, but the meaning varies depending on the process. In Java, your application can set a return code using System.exit()
. If JVM encounters a low-level error or uncaught exception, it's also possible it could return a non-zero value instead of the value explicitly returned by your application.