Edit Article

This article will teach you how to read from and write to text files. This is useful when you want to create your software's configuration file, text editor, and/or anything similar.

Steps

  1. 1
  2. 2
    Import packages.
  3. 3
    Create a static method which reads from file.
  4. 4
    Create a static method which writes to file.
  5. 5
    Go over to your main class and test it. This class contains the main(String[] args) method which starts your whole project.
  6. 6
    Play with it! Change the code, rewrite this project without looking for help, and stuff like that.

We could really use your help!

Can you tell us about
building muscle?
Can you help us
rate articles?
Yes
No
building muscle
how to build upper body strength
Can you tell us about
astrology relationships?
Yes
No
astrology relationships
how to attract Scorpio guys
Can you tell us about
wireless networking?
Yes
No
wireless networking
how to jam a network
Can you tell us about
electrical maintenance?
Yes
No
electrical maintenance
how to test a relay
Thanks for helping! Please tell us everything you know about
...
Tell us everything you know here. Remember, more detail is better.
Tips
Provide Details.
Please be as detailed as possible in your explanation. Don't worry about formatting! We'll take care of it. For example:
Don't say: Eat more fats.
Do say: Add fats with some nutritional value to the foods you already eat. Try olive oil, butter, avocado, and mayonnaise.

Tips

  • Don't just type the code from my screenshots into your project, investigate the code for a little bit and try to understand how it works, and then implement it into your own project. That's how you learn new things.

Article Info

Categories: Stub | Java

Thanks to all authors for creating a page that has been read 21 times.

Did this article help you?
Yes No