B
black-white
hello,
I use Vector or ArrayList to store my objects.
However, sometimes I need to sort those lists with considering just one
value. Is that possible?
For example:
Class a{
int value1;
int value2;
String name;
}
Vector myList=new Vector();
a object1=new a();
object1.fillValues(); //that gives some values to each variable...
myList.add(object1);
myList.add(object2);
..
..
......
myList.add(object1000);
Now, how can I sort that list just considering value1 in all objects?
I use Vector or ArrayList to store my objects.
However, sometimes I need to sort those lists with considering just one
value. Is that possible?
For example:
Class a{
int value1;
int value2;
String name;
}
Vector myList=new Vector();
a object1=new a();
object1.fillValues(); //that gives some values to each variable...
myList.add(object1);
myList.add(object2);
..
..
......
myList.add(object1000);
Now, how can I sort that list just considering value1 in all objects?