java - Debugging Program with Comparator -
i unable debug below. have created object called person
, however, comparator not working:
//here object comparator referring public class person { string firstname; string lastname; int z; public person(string l, string m, int e) { firstname=l; lastname=m; z=e; } } // comparator begins here public class customcomparator implements comparator<person> { public int compare(person object1, person object2) { @override return object1.firstname.compareto(object2.firstname); } }
Comments
Post a Comment