using java? how i'm going to get the data in notepad. in short of file streaming?

Recommended Answers

All 7 Replies

I'm not entirely sure what you mean..

Java IO takes care of reading and writing to files and such.

I suggest looking up the BufferedWriter class for writing and BufferedReader for reading.

Yes!..can you show me a sample code in file streaming in java?

getting data in notepad.

here u go!
Hope this simple code is informative for you!

import java.io.*;
import java.util.*;

class test
{

	public static void main(String ar[])
	{
		try(FileInputStream f=new FileInputStream("myTxT.txt"))
		{
			Scanner in=new Scanner(f);
			while(in.hasNext())
			{
				System.out.println(in.nextLine());
			}
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
		
	}
}

thanks a lot.. i really want to learn how to apply file streaming using java. :)

Mark this thread as solved, if u have got answers for your questions.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.