In the above statement, isbn is a primitive so you can't call compareTo method on it. But since it is a primitive, you can use comparison operator on it. So if you see the
source code of Integer class, the compareTo method is implemented like this
You can implement your compareTo method in the same way too. To make it even simpler, you can just write