top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is shadowing?

+1 vote
321 views
What is shadowing?
posted Dec 1, 2014 by Vinitha

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

There are two ways of shadowing either through scope or through inheritance.
• Hiding a method of child class and giving a new implementation is known as shadowing from inheritance.
• Shadowing through inheritance is the default when a derived class implements a method of base case which is not declared as overridden in the base class.
• Derived class member’s signature, return type, access level may differ from base class.
• Shadowing can be obtained by using the new keyword.
• Shadowing is one of the polymorphism’s concepts.

answer Dec 1, 2014 by Manikandan J
...