ksanjiv
asked on
Sort records Ascending order of precedence
Hi experts,
I have two different objects, for example
Ob1....................... .......... .......... .......... .......... ....
Attribute (row 1) (row 2) (row 3)
First name tom harry tom
Last name bob bob jhon
Occupation se se me
Company abc xyz pqr
Address aaa sss ddd
City ccc ccc bbc
Country rrr aaa zzz
Ob2....................... .......... .......... .......... .......... .
Attribute (row 4) (row 5) (row 6)
First name tom joe tom
middle name bob bob jhon
Address aaa sss ddd
City ccc aam ccc
state rrr aaa zzz
Now I need sort all the six records in the following order (Ascending order of precedence)
First name
City
Can someone help me &
I have two different objects, for example
Ob1.......................
Attribute (row 1) (row 2) (row 3)
First name tom harry tom
Last name bob bob jhon
Occupation se se me
Company abc xyz pqr
Address aaa sss ddd
City ccc ccc bbc
Country rrr aaa zzz
Ob2.......................
Attribute (row 4) (row 5) (row 6)
First name tom joe tom
middle name bob bob jhon
Address aaa sss ddd
City ccc aam ccc
state rrr aaa zzz
Now I need sort all the six records in the following order (Ascending order of precedence)
First name
City
Can someone help me &
Use Comparator: http://java.sun.com/j2se/1.5.0/docs/api/java/util/Comparator.html
ASKER
using Comparator i can compare only ... how will i sort the records .... can u write a sample code.... wud be helpful to me
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
can you post the expected result.. like u want them in a single object or the values should be sorted and the be rearranged with 3 sets in each obbject
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Forced accept.
Computer101
EE Admin
Computer101
EE Admin