Monday, 1 August 2016

Is System.exit takes negative value?


Yes, System.exit takes –ve value, As you see the documentation of System .exit, the signature looks like below.
public static void exit(int status);

public class Test {
 public static void main(String ptr[]) {
  System.out.println("I am displaying");
  System.exit(-100);
  System.out.println("I am not displaying");
 }
}

No comments:

Post a Comment