File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Java 2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Java 2" Watch "Java 2" New topic

Java 2

sheharyar alam

Joined: Mar 04, 2008
Posts: 4
hello guys

I am new at this stuff, so I am trying to learn this java stuff lol,

but anyway

My qustion is how do I Read text line by line and print it as it appears in the given data file
marc weber

Joined: Aug 31, 2004
Posts: 11343

Welcome to JavaRanch!

Take a look at the Scanner class.

If you're having trouble with it, show us what you've tried and where you're stuck.

"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
Rob Spoor

Joined: Oct 27, 2005
Posts: 19684

BufferedReader is another option, as it has a readLine() method. This does strip away the newline characters though, but I believe so does Scanner.

How To Ask Questions How To Answer Questions
I agree. Here's the link:
subject: Java 2