This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Ankitt Gupta wrote:Covariant type means your return type of the overriding method should be subclass of the return type of overridden method
I would say Ankitt it may be a subclass be not that it should be.
be a well encapsulated person, don't expose your privates, unless you public void getWife()!
Ruben Soto
Ranch Hand
Joined: Dec 16, 2008
Posts: 1032
posted
0
Or it could be an implementing class, or an extending interface, if the return type of the overridden method is an interface. The key is that the covariant return must pass the Is-A test for the return type of the overridden method.
All code in my posts, unless a source is explicitly mentioned, is my own.