Results 1 to 3 of 3

Thread: Exit in java

  1. #1
    deepali is offline Member
    Join Date
    Sep 2011
    Posts
    8
    Rep Power
    0

    Default Exit in java

    Hi,
    I want to terminate my java program when a particular condition is satisfied. Like the way we can do it in C and cpp exit(0) or exit(1). But I don't want to use System.exit(); as it terminates my whole
    application.
    Kindly suggest some solution for this.
    Thanks in advance...

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default Re: Exit in java

    It might be a good idea to explain the situation. How terminating a program differ from terminating an application?

  3. #3
    UJJAL DHAR is offline Senior Member
    Join Date
    Apr 2010
    Location
    Dhaka,Bangladesh
    Posts
    180
    Rep Power
    0

    Default Re: Exit in java

    Quote Originally Posted by deepali View Post
    Hi,
    I want to terminate my java program when a particular condition is satisfied. Like the way we can do it in C and cpp exit(0) or exit(1). But I don't want to use System.exit(); as it terminates my whole
    application.
    Kindly suggest some solution for this.
    Thanks in advance...
    What did you mean by "terminating whole application" ?
    System.exit(0)
    System.exit(1)
    If you are using GUI like JFrame you can use
    JFramename,dispose()
    Don't Forget to try yourself before asking others help.....
    Press REP, if you find their advices/solutions effective.

Similar Threads

  1. Could not find the main class: java. Program will exit
    By thewonkits in forum New To Java
    Replies: 3
    Last Post: 01-11-2012, 11:56 AM
  2. Replies: 4
    Last Post: 08-22-2011, 03:42 PM
  3. Java Result:-1....on calling exit
    By Cosmos in forum New To Java
    Replies: 2
    Last Post: 07-19-2011, 10:15 PM
  4. 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
  5. System.exit 0 or 1?
    By antgaudi in forum New To Java
    Replies: 3
    Last Post: 11-13-2008, 06:33 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
  •