Skip to main content
GameDev.net gamedev.net
🔒 Locked

[java] ExitCode?

Started by _Sigma Aug 9, 2007 at 3:48 PM 2 replies 700+ views
Original Post
_Sigma
_Sigma
Unlike C/C++ entry point( int main() ), java's returns void, therefore, there appears to be no exit code. I need my program to return a 32-bit integer for its exit code. Can this be done? Are there hacky ways around this at all? Couldn't find anything related on Google.... Cheers
Omega147
Omega147
Java's main method must be of type void. The default return value is zero, indicating success. If you wish the main method to return a different exit code, then you have to use the System.exit() method.
_Sigma
_Sigma
Perfect. Thanks guys!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.