oops ... i'm so sorry i was looking at the Collection Interface ....
thanks you so much ...
I hope it works as the same way as vectors since this is the first time i'll be using it
just two more quick questions
1) can i declare its object as two-dimentinal (like the way you can do to a vector)?
2) if i store all integer types in the collection object, it sould not have any problems getting the min and max, right?
Thanks a lot
> I hope it works as the same way as vectors since this is the first time i'll be using it
What are you refering to here? Collections? No, Collections is a utility class, consisting of handy static methods you call directly.
> 1) can i declare its object as two-dimentinal (like the way you can do to a vector)?
I don't understand what you are referring to here. Also, java.util.Vector is one-diemensional, although you can nest it: Vector<Vector><Integer>>.
> 2) if i store all integer types in the collection object, it sould not have any problems getting the min and max, right?
Maybe a demo is in order (I'll do it without generics).
List list = new ArrayList();
list.add(new Integer(5));
list.add(new Integer(-1));
list.add(new Integer(17));
list.add(new Integer(5));
Integer a = (Integer) Collections.max(list);
Integer b = (Integer) Collections.min(list);
> By the way, I have used multi-dimensional vector
> like:
>
> Vector v[] = new Vector[3];
That's an array of three vectors. Why insist on calling it "multi-dimensional".
One more thing: most forum members will tell you to move up from the historical Vector class to ArrayList or some other List type.
Vector[][] v = new Vector[3][6];
Yes, informally, that would be called "multi-dimensional", but really it's an array of arrays of Vectors. You have to compare that to languages like VB that really have multi-dimensional arrays. One nice thing about v being an array of arrays is that you can refer to individual rows:
Vector[] rowj = v[j];