Hi Anu,
According to Nick, i understand that Overriding and Inheritance are related to each other like try-catch block...so, we can't use either of the two. We have to use both. Am i correct? I am bit confussed.
First, I think I might have confused you. If so, I'm sorry about that! You can use inheritance
without overriding. For example, you might create an application with two classes, a
superclass and a subclass, in which the subclass inherits all of the superclass methods,
and does not override any of them. (In the subclass you might declare several new
methods, too.)
However, I believe (based on my earlier post) that you cannot override a method unless
it is inherited.
Is it possible to override a constructor?
Constructors cannot be overridden.
One more request..... Nick, can you please send me the link to K&B SCJP 6 Study Guide ? I am planning to take up the exam.
Here is an Amazon link:
http://www.amazon.com/o/ASIN/0071591060/ca0cc-20
Good luck, Anu!
- Nick