b3ta.com board
You are not logged in. Login or Signup
Home » Messageboard » XXX » Message 3066487 (Thread)

# sommit like dis?
Vector myVector = new Vector();
myVector.add(politican1);
myVector.add(politican2);

inside the Vector, they are stored as nameless Objects to get them back, u need to use casting, and assign to new
variables

Politican pol1, pol2;
pol1 = (Politican)myVector.get(0);
pol2 = (Politican)myVector.get(1);
(, Tue 20 Apr 2004, 1:45, archived)
# oh...
and u got 'import java.util.Vector;' first thing at the top of ur class file right...
(, Tue 20 Apr 2004, 1:46, archived)
# no
i stuck "import java.util.*" so it imports everything

i'll add .Vector and see if that helps
(, Tue 20 Apr 2004, 1:48, archived)
# ah
indeed it has fixed my problem, thanks :D
(, Tue 20 Apr 2004, 1:49, archived)
# tis cool
but .*; should av worked ... maybe was a typo there?

::heads back to evil Java dissertation::
(, Tue 20 Apr 2004, 1:53, archived)