This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Read from keyboard, Scanner or Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Read from keyboard, Scanner or" Watch "Read from keyboard, Scanner or" New topic
Author

Read from keyboard, Scanner or

abalfazl hossein
Ranch Hand

Joined: Sep 06, 2007
Posts: 635


What is the advantage of usage BufferedReader vs scanner while reading from keyboard?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 44515
    
  34
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

Joined: Dec 29, 2009
Posts: 93
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

Joined: Oct 13, 2005
Posts: 44515
    
  34
I think that is an advantage of using Scanner vs BufferedReader.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Read from keyboard, Scanner or
 
It's not a secret anymore!