Can someone help me how to read and write text file using Java Code... ???

Thanks in advance..

Recommended Answers

All 6 Replies

Can someone help me how to read and write text file using Java Code... ???

Thanks in advance..

can you show us how you tried so far?

Can someone help me how to read and write text file using Java Code... ???

Thanks in advance..

Start you own thread. This thread started by someone who had a problem. Now, do you expect people to start helping you and stop answering the other guy's question?
Start your own thread and you will get plenty of answers and example code

Start you own thread. This thread started by someone who had a problem. Now, do you expect people to start helping you and stop answering the other guy's question?
Start your own thread and you will get plenty of answers and example code

Malaka don't tell me what to do... the other guy might learn from this and since is the same problem, You want to have 200 posts with the same problem everyday answering to the same post.....

<deleted profanity>

commented: Clueless and rude. -2
commented: Bad attitude. -2

Malaka don't tell me what to do... the other guy might learn from this and since is the same problem,

since it is the same problem, as you state, just wait untill it's solved. since JavaAddict is one of the persons you would like to help you, maybe you should let him give you advice.
the 'other guy' won't learn a thing from someone else repeating his question and us just giving code as a free-bee. the point is that you at least try something for yourself, which neither you or he has done so far

You want to have 200 posts with the same problem everyday answering to the same post.....

No we will not have 200 post with the same question, because when you have a question the easiest thing to do is search the forum in case it has already been answered. That is the point of having a forum, so people will find the answer they are looking for. And if you can't find the answer then start a new thread. Otherwise we will be communicating with PMs and no one will ever post anything.

you can read by using scanner and write by using printstream

to read from file save.txt:
Scanner in = new Scanner(new FileReader("save.txt"));
System.out.println(in.nextLine());

to write to file save.txt:
PrintStream out=new PrintStream(new FileOutputStream("save.txt"));
out.println("i want to save this file");

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.