Classes

I'm pretty new to Java, but not to programming. I'll try to explain my question as best I can. Let's say I was making a little test application that kept track of bank accounts' balances. I guess the best way would be to have an Account class that had a variable to hold the balance. But what if I wanted it to store as many accounts as the user wants? How do store all the accounts and be able to iterate through them and spit out their balances? With C++, you could just make a struct with a variable for the balance and store them in a vector and cycle through them to get their contents, but I think there is no such thing as a struct or vector in Java right? If that's true, how would I do this?

[712 byte] By [Grantyt3a] at [2007-10-2 4:46:51]
# 1
Look at the java.util.ArrayList class.
FuzzyOniona at 2007-7-16 0:51:39 > top of Java-index,Java Essentials,New To Java...
# 2
Hold on, it looks like this page might have what I'm looking for: http://java.sun.com/docs/books/tutorial/java/javaOO/classes.html
Grantyt3a at 2007-7-16 0:51:39 > top of Java-index,Java Essentials,New To Java...
# 3
To have a vector type object you'll want to use the ArrayList class I mentioned.
FuzzyOniona at 2007-7-16 0:51:39 > top of Java-index,Java Essentials,New To Java...
# 4
Yep, that's exactly what I need! Thanks!
Grantyt3a at 2007-7-16 0:51:39 > top of Java-index,Java Essentials,New To Java...