
-----------------------------------
Kuntzy
Tue Sep 28, 2004 9:55 am

File I/O ... Reading and Writing to a file
-----------------------------------
Can anyone plz give me a tutorial on reading and writing to a file in java console? I searched the tutorials in java but i couldn't find what I need ... maybe sum example like opening a file with numbers in it and modifying them.

-----------------------------------
.hack
Thu Oct 14, 2004 8:35 am


-----------------------------------
I second this motion. My Programming taecher doesn't even know Java yet some how he got a job teaching it. So his way of teaching us is telling us what to read out of thise POS holtsoft book and learn it that way using "Ready To Java" (Actually named, "Wasting Your Time").

Anyways the book has l9ike 4 pages on IO except the code they give you doesn't work because this book was made by a group of tools. Example.


// The "OddInts" class.
import java.awt.*;
import hsa.Console;
import java.io.*;

public class OddInts
{
    static Console c;           // The output console
    
    
    public static void main (String[] args)
    {
        c = new Console ();
        

        PrintWriter output;
        String fileName;
        
        
        c.println ("What is the name of the file for the integers?");
        fileName = c.readLine();
        output = new PrintWriter (new FileWriter (fileName));
        for (int number = 1;number 