The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

and what the code does above is basically reads in a text file line by line and stores all its contents in a sing String named text.

What i want it to do is it to store each line into an undefinied string array however im getting no where. Do you guys have any suggestion of how i can alter the code above to have each line stored in a seperat part of the array for example

More of a pet-peeve than anything else, but usually when you declare a List (you have used a Vector in this case) you want to specify what type of Objects are in that list. This is just a way to make it easier to access the Objects, as you will not need to cast the objects when you get them. This is not as much of an issue when you use Lists of Strings, as they are easy to cast since their Object Representation is just a String of its value (sort of odd, and I'm unsure how to explain it).

However, this does become a problem if you had a Vector of Objects other than Strings. For example, a Vector of JFrames.
If you declared your Vector using the way you did: Vector myVector = new Vector();, you would access the JFrames by saying:

So, the more acceptable way of creating your Vector above (acceptable meaning the general consensus of the programming community) would be saying:

Vector<String> myVector =new Vector<String>();

Once again, sort of a moot point when you have a Vector of Strings, but it is good advise to have on the back-burner for your future data structures. Tell me if I am unclear.

NOTE TO NEW PEOPLE LOOKING FOR HELP ON FORUM:

When asking for help, please follow these guidelines to receive better and more prompt help:
1. Put your code in Java Tags. To do this, put [highlight=java] before your code and [/highlight] after your code.
2. Give full details of errors and provide us with as much information about the situation as possible.
3. Give us an example of what the output should look like when done correctly.

Join the Airline Management Simulation Game to manage your own airline against other users in a virtual recreation of the United States Airline Industry. For more details, visit: http://airlinegame.orgfree.com/