does someone know how can i obtain the getch() function in java?
Hi Friend,
In java, you can use the method next() of Scanner class.
Here is an example:
import java.util.*;
class Hello{ public static void main(String[] args) { Scanner input=new Scanner(System.in); System.out.println("Enter: "); String st=input.next(); System.out.println("You have entered: "+st); } }
Thanks
Ads