12-23-2009 07:03 AM
I am not sure if this is the right forum for queries exclusive to j2me. But i am hoping someone can help me with this......
Actually i have a while loop within which i create an custom object and assign values to its attributes. At the end of each iteration i wish to add this object to a vector object. I use addElement() for this.
The problem i am facing is when i insert the 2nd object to the vector, the attribute values of the first one are lost and instead the attributes of both the objects in my vector have same values .i.e. value of the 2nd entry........
Firstly i would like to know if vector supports complex data types. If yes then can anyone tell me how to insert them into vector?
Thanks in advance,
Solved! Go to Solution.
12-23-2009 07:20 AM
Can you share code of your complex object? I don't think that it's problem of the Vector. I'm sure that you use static fields and you are rewriting them when you create the second object for vector.