• Post Reply Bookmark Topic Watch Topic
  • New Topic

comparator for ArrayList  RSS feed

 
Sekhar Chand
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

i have to write one comparator for On bean(A).
But that bean contains, some other beans(B,C,D.....) as instance variables.
So can anybody tell me how to write comparator for that bean(A),
so that properties in B,C,D also have to be compared

Thanks in advance
Sekhar
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Isn't it a matter of "connecting the dots"? For example...

bean.getSubBean1().getInstanceVarA();
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!