This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
pong lai pong wrote:
it prints : "Elements of vector:[Student@19821f]"
what did i do wrong? the name doesnt show up. does it mean that the vector has different elements in it?
please help me im a total noob
sVector is a Vector
You are printing Vector but not Student Name.
pong lai pong
Joined: Aug 02, 2011
I wanted to seee the name David and he student number which is 1....because im gonna manipulate it later...
but i dont know how to access it
You'll need to override the toString() method in class Student to print out something useful. Otherwise it will inherit the implementation from the super class, which in this case is Object. This implementation returns the class name, followed by an @ and the hexadecimal representation of the hash code.