View Single Post
  #10 (permalink)  
Old 04-22-2008, 02:51 PM
Eranga's Avatar
Eranga Eranga is online now
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 4,602
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Few error there. Defining variables as local or global is depend on the way you implementing the application.

Look at this code.

Code:
import java.io.*; /** * * @author Eranga */ public class ReadFile { FileInputStream fiStream; DataInputStream diStream; BufferedReader br; public static void main(String[] args) { // TODO code application logic here new ReadFile().readFile(); } public void readFile() { try { fiStream = new FileInputStream("D:\\jazz\\CSV\\abcd.txt"); diStream = new DataInputStream(fiStream); br = new BufferedReader(new InputStreamReader(diStream)); String ss; while((ss = br.readLine()) != null){ System.out.println(ss); } } catch (IOException ex) { System.out.println(ex.getLocalizedMessage()); } } }
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Reply With Quote