Created
March 10, 2012 13:49
-
-
Save tamizhgeek/2011455 to your computer and use it in GitHub Desktop.
Contact class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Contact { | |
protected String name; | |
protected String number; | |
protected String id; | |
protected Contact(String name, String number) { | |
this.name = name; | |
this.number = number; | |
} | |
/** | |
* @return the string for the Listview */ | |
@Override | |
public String toString() { | |
return name + ":" + number; | |
} | |
public int compareTo(Contact c) { | |
String c1 = c.name.toUpperCase(); | |
String c2 = this.name.toUpperCase(); | |
return c2.compareTo(c1); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment