Results 1 to 3 of 3
  1. #1
    Cosmos is offline Member
    Join Date
    Jul 2011
    Location
    New Delhi,India
    Posts
    56
    Rep Power
    0

    Question Java Result:-1....on calling exit

    i wrote the following code-


    package javalang;

    public class SystemClass {
    public static void main(String[] args) {
    //System.out.println("time:"+System.currentTimeMilli s());
    //System.exit(1);
    Runtime.getRuntime().exit(-1);
    System.out.println("hello");
    }

    }


    and the o/p was-

    Java Result:-1

    i know that passing 0 as input means successful termination of program and any other argument means some sort of abnormal termination.....but

    my question is what does Java Result:-1 means????

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default

    what does Java Result:-1 mean
    The meaning is what the caller of the program agrees that it should mean.
    The OS can have a set of return codes that have a meaning. The program will return one of them depending on what it wants to tell the OS. Some batch/script file/executors can read the code returned by a program and use it to control their processing

    A company I worked for in San Francisco had -1906 as an error code meaning the program had a terrific error.
    (1906 was the year of the fire)
    Last edited by Norm; 07-19-2011 at 10:03 PM.

  3. #3
    Cosmos is offline Member
    Join Date
    Jul 2011
    Location
    New Delhi,India
    Posts
    56
    Rep Power
    0

Similar Threads

  1. Struts 2 error : No result defined for action / result
    By sameerk in forum Web Frameworks
    Replies: 1
    Last Post: 05-17-2011, 10:15 AM
  2. Replies: 1
    Last Post: 03-09-2011, 03:45 PM
  3. New To Java - Input Number Won't Prompt, Wrong Result
    By jhuwalker in forum New To Java
    Replies: 2
    Last Post: 01-31-2011, 10:29 PM
  4. Java Result: 255
    By MadJack in forum New To Java
    Replies: 14
    Last Post: 11-11-2010, 08:54 AM
  5. How to exit the program by typing "exit"?
    By Laythe in forum New To Java
    Replies: 6
    Last Post: 08-19-2009, 08:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •