• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Read from keyboard, Scanner or

 
abalfazl hossein
Ranch Hand
Posts: 635
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


What is the advantage of usage BufferedReader vs scanner while reading from keyboard?
 
Campbell Ritchie
Sheriff
Pie
Posts: 49466
64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
abalfazl hossein wrote: . . . What is the advantage of usage BufferedReader vs scanner while reading from keyboard?
None. But it's Scanner not scanner.
 
Ashish Schottky
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no advantage of using Scanner against BufferedReader,but it makes reading from keyboard easier in terms of programing.
In BufferedReader, one has to take input in terms of String and then parse it into required data-type, this can be avoided using Scanner can easily take inputs without conversions.
But its not an advantage, it just makes life of programmer simpler.
 
Campbell Ritchie
Sheriff
Pie
Posts: 49466
64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that is an advantage of using Scanner vs BufferedReader.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic