I was wondering if there is any way to compare a String object in Java. Because I would like to sort some objects by their "names", a String. If not, how would you suggest I approach the problem?
The object is not Strings. The object is a own specified Class which includes a String object which I would like to sort them from.
Class MyClass
{
String mName;
MyClass(String name)
{
mName = name;
}
}
Then I would like to sort an array of the Object MyClass by their member mName.