function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Comparable interface problem

hi to all,
Here i am facing the problem.
here i written some piece of code for sorting account name or account annual revenue like that.
Here i  written some piece of code.  i am unable to solve the solution.
So please help me.
public class ComparableAccountNames_controller {
   public list<WrapperClass> wraperlist{get; set;}
   public list<account> actlist {get; set;}
   public ComparableAccountNames_controller(){
       actlist = [select id, name, phone from account limit 10];
   public class WrapperClass implements comparable {
       public string {get; set;}
       public integer {get; set;}
       public WrapperClass(,{ =; =;
         global Integer compareTo(Object ObjToCompare) {
             return actlist.Name.CompareTo(((WrapperClass)ObjToCompare).actlist.Name);

Thanks in advance 
Amit Chaudhary 8Amit Chaudhary 8
Please check below post for Wrapper sorting that will help you

Please let us know if this will help you

Amit Chaudhary
Hi Amit,
Here i want to sort the columns like account number or  annual revenue.
 I want to implement the Comaprable interface.
Please help me .