0
How to get I/p for any type using Scanner
how to get I/p for any type w/o using integer.parsint etc using Scanner or any other efficient way
1 Answer
+ 12
Scanner scan = new Scanner(System.in);
String str = scan.nextLine(); // string
int a = scan.nextInt(); // integer
double b = scan.nextDouble(); // double