/* Author : Michael Robinson Program : pauseClass.java Purpose : This program creates a method called pause() which allows the user to stop the program at any particular place. Updated : April 26, 2099 */ import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class pauseClass { public static void pause() { // make a prompt System.out.print( "\nPress ENTER to continue " ); //open a reader over the keyboard (System.in) stream. //class object method BufferedReader in = new BufferedReader( new InputStreamReader( System.in ) ); //checking for errors try //execute the following line of code { String line = in.readLine(); // read one line. } catch (IOException ioe) { //if an error was detected execute the following System.out.println( "Something went wrong reading IO:" ); ioe.printStackTrace(); } }//end public pause() public static void main( String arg[] ) { pause(); System.out.println( "\n Thank you!\nend of program" ); }//end public static void main( String arg[] ) }//end public class pauseClass