Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 BufferedReader vs. Scanner
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
blackhawk_prince




PostPosted: Tue Jul 15, 2008 8:43 pm   Post subject: BufferedReader vs. Scanner

Hi I am currently trying to improve the efficiency of my code. What is the major differences between Scanner and BufferedReader for reading form a text file (efficiency wise) Also does anyone know a webpage with contests or tutorial for improving in contests.
Sponsor
Sponsor
Sponsor
sponsor
gitoxa




PostPosted: Tue Jul 15, 2008 9:30 pm   Post subject: RE:BufferedReader vs. Scanner

I'm not too familiar with Java, but as for the second part, the only real way to improve at contests is to do them. There's no real "tutorial" for them.
Nick




PostPosted: Tue Jul 15, 2008 9:53 pm   Post subject: RE:BufferedReader vs. Scanner

I think he means a contest of who can improve the code better, not improving on doing contests
DemonWasp




PostPosted: Wed Jul 16, 2008 9:15 am   Post subject: RE:BufferedReader vs. Scanner

Both Scanner and BufferedReader are quite efficient for reading files. Unless you have an extraordinarily large text file, either should be serviceable. The main difference is that the input methods in Scanner are generally easier to use, though of course that depends on exactly what you're coding.

If you want to make your program run faster, you have to figure out what it's spending most of its time doing / spending the most memory on. Then you can make those parts faster, without wasting your time on parts that don't need it. Look into a piece of software called a "profiler", that may help you find out what your program is spending all its time doing.
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: