Home  >  Forum  >  Core Java
Post New Query

java.lang.ClassCastException: cannot be cast to java.lang.Comparable


joined on
May 23,2013
Asked on May 28,2013
Hi All,

Need help for below error.

Exception in thread "main" java.lang.ClassCastException: cannot be cast to java.lang.Comparable
at java.util.Collections$ReverseComparator.compare(Unknown Source)
at java.util.Arrays.mergeSort(Unknown Source)
at java.util.Arrays.sort(Unknown Source)
joined on
March 14,2013
Replied on May 28,2013

The class which object is being created need to implement Comparable interface and override compareTo method.

Write Answer








Copyright ©2017 concretepage.com, all rights reserved |Privacy Policy | Contact Us