Results 1 to 4 of 4

Thread: System.exit(0);

  1. #1
    Nirantak is offline Student
    Join Date
    Dec 2012
    Posts
    1
    Rep Power
    0

    Default System.exit(0);

    what does the 0 mean in System.exit(0);
    and
    what is the difference between random numbers from - Math.random or java.util.Random;

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default Re: System.exit(0);

    What did Google tell you?

    Honestly both those questions are answered there.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,458
    Rep Power
    20

    Default Re: System.exit(0);

    Thread moved. Please don't post beginner questions in the Advanced Java section.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  4. #4
    quad64bit's Avatar
    quad64bit is offline Moderator
    Join Date
    Jul 2009
    Location
    VA
    Posts
    1,323
    Rep Power
    7

    Default Re: System.exit(0);

    The 0 is the exit code. There is a long history of exit codes and what they mean, generally, 0 is a normal (everything went fine) code, and anything else is an error code (usually 1).

    Math.random uses an instance of Random to do what it does - but using java.util.Random directly gives you access to a lot more functionality.

Similar Threads

  1. Exit System
    By jboy in forum New To Java
    Replies: 5
    Last Post: 09-14-2009, 09:27 AM
  2. Avoiding system.exit()
    By swati.jyoti in forum New To Java
    Replies: 5
    Last Post: 07-01-2009, 11:17 AM
  3. System.exit 0 or 1?
    By antgaudi in forum New To Java
    Replies: 3
    Last Post: 11-13-2008, 07:33 PM
  4. System.exit() in catch block.
    By new_2_java in forum Advanced Java
    Replies: 8
    Last Post: 06-24-2008, 04:45 PM
  5. system.exit(..)
    By ramakanta.majhi in forum New To Java
    Replies: 2
    Last Post: 06-14-2008, 02:28 AM

Posting Permissions

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