Also, In the case of Comparable, why compareTo() method is coming twice ?
It is coming twice because you are defining the way tow Employee objects have to be compared.
And for that, tou rely on comparing their name (which is string). And String class implements Comparable<String> which means this class has implemented compareTo method.
I think for primitives, we have to use -(minus) to check the value(negative or positive or equal) and NOT compateTo() method. For non-primitives use, compareTo() method and not -(minus). String and Wrappers classes implemented this compareTo() method. This syntax looks good to me. Maybe somebody can point out if there is a mistake.