So I have this small bit of code
import java.util.Comparator;
public class PersonFullNameComparator implements Comparator<Person> {
@Override
public int compare(Person arg0, Person arg1) {
return arg0.getFullName().compareTo(arg1.getFullName());
}
}
I was reading about singletons earlier and don't quite get it, I am not sure where to go or start.
So how would I make this a singleton? Just this class.
Edit: It's just for practice, not doing anything very practical with it. More curiosity due to examples unlike it.