class AC
{
    int ID;
    String name;
    int AcNo;
    Date ODate;
    double balance;
    double transaction;
    AC(int ID,String name,int AcNo,Date ODate,double balance,double transaction)
    {
        this.ID=ID;
        this.name=name;
        this.AcNo=AcNo;
        this.ODate=ODate;
        this.balance=balance;
        this.transaction=transaction;
        
    }

this is my main class
i want to write those data which are relevant to those variable variables in an external text file

Recommended Answers

All 4 Replies

Search this forum for examples on how to use this class:

BufferedWriter

BufferedWriter wr = new BufferedWriter(new FileWriter("filename"));
wr.write("something");
wr.newLine();


wr.close();

Thanks for this javaaddict ..
:)
cant we add several records without over writing the existing content of the text file...if so please provide the code

You can open your filewriter in "append" mode by changing it to
new FileWriter("filename", true)

Thanks for this javaaddict ..
:)
cant we add several records without over writing the existing content of the text file...if so please provide the code

If you have any further questions you should check first check the API for the classes you are using. You will probably find there what you need.

Be a part of the DaniWeb community

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