use of system.exit(0)

Posted by Warrior on Stack Overflow See other posts from Stack Overflow or by Warrior
Published on 2009-01-19T11:37:18Z Indexed on 2010/03/21 7:01 UTC
Read the original article Hit count: 277

Filed under:
|
public class WrapperTest {
    static {
        print(10);
    }

    static void print(int x) {
        System.out.println(x);
        System.exit(0);
    }
}

In the above code System.exit(0) is used to stop the program. What argument does that method take? Why do we gave it as 0. Can anyone explain the concept?Thanks.

© Stack Overflow or respective owner

Related posts about java

Related posts about exit-code