3
Contributors
7
Replies
10
Views
5 Years
Discussion Span
Last Post by stevanity
0

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.

0

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();
		}
		
	}
}
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.