September 09, 2010, 01:52:05 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  Home Help Media Affiliates Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: How to read a textfile and output it , BufferedReader & Scanner  (Read 1160 times)
0 Members and 1 Guest are viewing this topic.
Javaforums.net moderator team
Moderator
Senior Member
*

Reputation: 0
Offline Offline
Posts: 9398
Referrals: 0

WWW Awards
« on: July 25, 2008, 05:02:55 PM »

How to read a textfile and output it , BufferedReader & Scanner
      


Here's a demo I wrote some time ago to read a file and output it in the console. I've created 2 versions. One that uses the "Scanner object" and the other the "BufferedReader object" to read the text files from disk.
Both examples of mine work, but the Scanner version is preferred.
BufferedReader version:

public class ReadFile {
public [...]
      

http://www.engineeringser...t-bufferedreader-scanner/
      
Logged

Get directly in touch with our clients and reply to their job offers!

Please use (code=java)your code goes in here(/code) tags when posting code. (use [] instead of () )
GET PAID $0.06 FOR EACH SEARCH!! sign up under this link to get $10!

ES-Staff
Engineeringserver.com staff
Javaforums.net :: a community about Java software development.
« on: July 25, 2008, 05:02:55 PM »

Your Ad Here
 Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.10 | SMF © 2006-2009, Simple Machines LLC
TinyPortal v0.9.8 © Bloc
Valid XHTML 1.0! Valid CSS!
Page created in 0.171 seconds with 33 queries.

Google visited last this page September 03, 2010, 08:06:03 PM