You have many option to get input form user. you can use below classes for getting input from user.
1)InputStreamReader istream = new InputStreamReader(System.in) ;
2)BufferedReader bufRead = new BufferedReader(istream) ;
3)Scanner a = new Scanner(System.in);
if u r using first and second, you need to use readLine() method. On other hand, you need to use nextLine().
15 Million Students Helped!
Sign up to view the full answer