return this.User.compareTo(arg0.User);
When you write this line, you compare the User object and return the result.
Comes this
, which points to the current instance, when you pass the "Other" to this method, it is called in the current instance, which is compared with the passed objects User
.
If you see the signature
public class Other implements Comparable<Other>{
public String User;
String, User
.
, .
:
Collections, , , . .