Results 1 to 2 of 2
Thread: Which is better?
- 05-11-2010, 08:06 AM #1
Member
- Join Date
- Mar 2010
- Posts
- 4
- Rep Power
- 0
Which is better?
Hi,
Among Scanner ,BufferedReader and DataInputStream which is bettter one and why?
Please Give the Difference between all three.
Also,
BufferedReader br=new BufferedReader(InnputStreamReader(System.in))
[please explain this line(each word)]
I know how to use these but don't know why and when to use and basic difference.
Thanks.
- 05-11-2010, 10:06 AM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,405
- Blog Entries
- 7
- Rep Power
- 17
As you wrote yourself already: each has its own use; a DataInputStream can read primitive values in their binary form. A Scanner can read those in their textual form. A BufferedReader is a text only thing and its real functionality is the buffering of the (text) data. You can't say which one is best because those classes have different functionality.
kind regards,
Jos


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks