Java Stop
- Ham Sandwich $8.49 Includes lettuce, tomato, onion, cucumber, pickles, sprouts, mayo, mustard, and ham.
- Natural Sandwich $8.49 Includes lettuce, tomato, onion, cucumber, sprouts, plain cream cheese.
- Veggie Sandwich $8.49 Includes lettuce, tomato, onion, cucumber, pickles, sprouts and your choice of cheese.
Full Answer
System.exit () to Terminate a Java Program
For anyone who doesn’t know how to end program in Java, there is a lot of ways to do this. Firstly, we can use the exit () method of the System class, honestly, it is the most popular way to stop a program in Java. System.exit () terminates the Java Virtual Machine (JVM) that exits the current program that we are running.
How to end program in Java in an if statement in java
One of the others way about Java stop program based on if statement condition. Then, please follow example below.
How to end java program using return
We mention one more way for Java stop program, you can use return statement.
Sum up
All in all, that’s all about how to end program in java. Moreover, we hope this is a useful post for you. However, if you still have questions about Java or how to end program in Java, please contact us. ArrowHitech has become one of the superior IT outsourcing Vietnam company.