Tuesday, November 29, 2011

What is the difference between Comparable and Comparator

The Comparable is for natural ordering and Comparator is for custom ordering. But we can override the compareTo method of comparable interface to give a custom ordering.
Category:Java Interview Questions

No comments:

Post a Comment