About 103,000 results
Open links in new tab
  1. Terminating a Java Program - Stack Overflow

    Mar 17, 2014 · Calling System.exit(0) (or any other value for that matter) causes the Java virtual machine to exit, terminating the current process. The parameter you pass will be the return …

  2. How to quit a java app from within the program - Stack Overflow

    Jan 15, 2014 · You can use System.exit() for this purpose. According to oracle's Java 8 documentation: public static void exit(int status) Terminates the currently running Java Virtual …

  3. How do I use System.exit() in Java - Stack Overflow

    Dec 17, 2024 · System.exit () Method can be use to terminate program so when you use this method it will terminate program as it reached to parameter value of System.exit () method.

  4. How to break out or exit a method in Java? - Stack Overflow

    Jun 3, 2016 · The keyword break in Java can be used for breaking out of a loop or switch statement. Is there anything which can be used to break from a method?

  5. java - Best way to exit a program when I want an exception to be …

    May 30, 2011 · I'm writing a Java program that reads in a file of words. The program crucially depends on this file, so I really do want the program to end if for whatever reason there's an …

  6. How to exit a program with an exit code: Java - Stack Overflow

    Apr 23, 2015 · I have an application in Java. I'd like to specify the "exit code" of my console application. How can I apply an exit code for the registerButton? final JTextField passwordText …

  7. How to add option to exit from switch case in Java

    Aug 30, 2015 · I am creating a menu based program in java using switch case. here are 4 cases: add record delete record update record Exit I added break after each case but, what I want to …

  8. Running code on program exit in Java - Stack Overflow

    Is it possible to write a method that System.exit will call when you terminate a program?

  9. Difference in System. exit(0) , System.exit(-1), System.exit(1 ) in Java

    May 6, 2016 · I'd like to know the difference between the following in Java System.exit(0); System.exit(-1); System.exit(1); When do I have to use the above code appropriately?

  10. create an exit button in java? - Stack Overflow

    Mar 9, 2014 · I'm a beginner in java, I'm practicing a Project that have should create an exit button that exit the program when we press it. But when I run this project in JDK the exit button is not …

Refresh