Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 6 of 6

Thread: beginner's question

  1. #1
    Junior Member
    Join Date
    Sep 2010
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Red face beginner's question

    what does "System.exit()" mean?
    a good programmer can write a Java program in any language


  2. #2
    Member
    Join Date
    Jul 2010
    Location
    Washington, USA
    Posts
    307
    Thanks
    16
    Thanked 43 Times in 39 Posts

    Default Re: beginner's question

    System.exit(); //Terminates the currently running Java Virtual Machine.


    Source: System (Java 2 Platform SE v1.4.2)

  3. #3
    Junior Member
    Join Date
    Sep 2010
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: beginner's question

    I don't know what that means... as I wrote, I'm a beginner...
    a good programmer can write a Java program in any language

  4. #4
    Member
    Join Date
    Jul 2010
    Location
    Washington, USA
    Posts
    307
    Thanks
    16
    Thanked 43 Times in 39 Posts

    Default Re: beginner's question

    It stops your currently running program.

  5. #5
    Junior Member
    Join Date
    Sep 2010
    Location
    Netherlands
    Posts
    10
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: beginner's question

    yeah, so lets say you got an application with a button.
    And if you press the button "System.exit();" will be called, that means that your application will end(terminate) if you press the button

  6. #6
    Forum VIP
    Join Date
    Jul 2010
    Posts
    1,655
    Thanks
    25
    Thanked 325 Times in 302 Posts

    Default Re: beginner's question

    Quote Originally Posted by Brt93yoda View Post
    It stops your currently running program.
    Yep, if there is a particular point of the program where you would want to programmatically terminate the program, you would code:
    System.exit(0);