javaQQ
asked on
Accessing a vector of vectors of vectors.
I have two related questions regarding Vectors.
Question 1:
This code gives me the second value in the first element of a vector of vectors
((Vector)theVector.element At( 0 )).elementAt(1);
My question: How do I extend this for one more level (to a vector of vectors of vectors)?
For example, how do I get the the third value in the second vector of the first vector?
Question 2:
Code like the following
variableX = (String)((Vector)theVector .elementAt ( 0 )).elementAt(3);
causes a "java.lang.ClassCastExcept ion" error:
apple.awt.EventQueueExcept ionHandler Caught Throwable: java.lang.ClassCastExcepti on
Am I right in assuming that this is the reuslt of the code pointing to the wrong level of vector and
can be solved by the code which ppoints to the right level of vector?
Many thanks in advance.
Question 1:
This code gives me the second value in the first element of a vector of vectors
((Vector)theVector.element
My question: How do I extend this for one more level (to a vector of vectors of vectors)?
For example, how do I get the the third value in the second vector of the first vector?
Question 2:
Code like the following
variableX = (String)((Vector)theVector
causes a "java.lang.ClassCastExcept
apple.awt.EventQueueExcept
Am I right in assuming that this is the reuslt of the code pointing to the wrong level of vector and
can be solved by the code which ppoints to the right level of vector?
Many thanks in advance.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I will split the points between the two respondents.
Again many thanks.