It is written in it instanceof.
Also, as Tom Hotin mentioned in a comment, if you are using Java 1.5 or later, you can write compareTo(Employee emp)to not use it at all instanceof. There was a detailed section on writing comparable types in the Object Ordering Java Tutorial.
source
share