Online Training Spring Hibernate Training in Delhi R Programming Training Course Big Data and Hadoop Training Java Training  

getch() method in java



Share on Google+Share on Google+

saba s
getch() method in java
1 Answer(s)      6 years and 9 months ago
Posted in : Java Interview Questions

does someone know how can i obtain the getch() function in java?

View Answers

November 20, 2010 at 1:14 PM

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.out.println("Enter: ");
        System.out.println("You have entered: "+st);



Related Tutorials/Questions & Answers: