In this example we will show the method to terminate running in Java.
Source Code
package com.beginner.examples;
public class TerminateExample {
public static void main(String[] args){
System.out.println("exit");
System.exit(0); // terminate running
}
}
Output:
exit