How to write XML file with Java and read it?

How do I write a program that reads from .txt file in Java?

  • I have a .txt file that has 3 lines of data, each of which has 3 data in them (separated by space). My text file is as follows: 2468 5 PlayStation 1357 3 XBoX 1597 4 GameBoy (code amount name) <--- this isn't in a file, just explains what these numbers are. The data that are read from a file should be loaded into one of the Java collections (e.g. Vector, ArrayList or LinkedList). After that, user inputs the code of the product and it's amount, and program updates the amount of the article in collection and later displays the user a name of the product he bought. After finishing (just before exit), the updated info is written into a file over the old info. How do I do this? If you got questions, e-mail me: [email protected]. Thanks a lot!

  • Answer:

    My answer is this. Don't ask people to do your homework or programs. Try browsing the multitude of online programming forums for answers to your questions. If you ask this same question, they will more than likely give you the same answer I am giving you. Instead of asking how to do an ENTIRE assignment, ask individual specific questions. You will be much likelier to get a response or answer if you do that.

Boris Jakovljević at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.