You can make an object of class BufferedReader and then you can use:
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Please enter a key to continue: ");
br.readLine();
In this way, it'll act as 'getch()' function in C.
You can do this with Scanner also. What you do in getch() and here is you asks user for input but doesn't assign that value to any variable.
Scanner input = new Scanner(System.in);
/* Other code
*/
input.nextLine();
We have done the same thing in both the examples and what you have presented is sleeping the program 2000 miliseconds, you can adjust that as you want.