yeah it is necessary that the return type of the overriding method should be same.
however, the access modifier can be different.
keep in mind:: We can not make the access modifier more restricted in the subclass.
eq. A overridden method cant be declared as private, if it is public in Super class.
restriction level for access modifier::::
public < protected < default<private
Good luck!!
A small leak can sink a Gigantic ship.>
Keep in mind that this feature (called covariant returns) is added in Java 5.0. In Java 1.4 and before Raza's statement is correct - the return types must be the same.
You really ought to be looking, not at the K&B book, but at the Java™ Language Specification, which is the official documentation. That confirms that K&B are in fact correct, but there is a subtle difference: you can understand K&B