Implement the Camparable interface, and override the compareTo method.
Then you have to decide how to compare the objects.
fr'instance - if comparing instances of type 'Person' would you consider
salary, height, or weight to decide which is greater-than, less-than, or
equal ??? - its up to the programmer (you) to decide.
"Dheeraj" <dh*******@excite.com> wrote in message
news:29**************************@posting.google.c om...
Hi :
I am writing a test utility where i wish to compare two Java objects.
The object consists of many other objects. In other words the objects
tree is deep.
Does anyone one how to compare such objects. I was trying to use Java
refelction to navigate and compare.
Thanks
Dheeraj
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
http://www.grisoft.com).
Version: 6.0.690 / Virus Database: 451 - Release Date: 5/22/2004