0
How to get character input from user with using datainputstream class in java
How to get character input from user Using datainputstream class
2 Réponses
0
Try using
import java.util.Scanner;
class accept{
Scanner read = new Scanner(System.in);
String x = read.nextLine();
System.out.println("You just keyed in "+ x);
}
0
I have found the right answer correct answer is
Scanner res=new Scanner(System.in);
Char a;
System.out.print(enter character);
a=res.next().charAt(0);
System.out.print("chracter is:--"+a);