What is shadowing?

Answer Posted / rohatash

there are overloaded methods in the base class, & u
marks one of the methods as shadows using the keyword
shadow in the derived class, then we cannot access the
overloaded methods.
Module Module1

Class A
Public Sub Show()
Console.WriteLine("Calling from A")
End Sub
End Class

Class B
Inherits A
Public Shadows Sub Show()
Console.WriteLine("Calling from B")
End Sub
End Class

Class C
Inherits B
Public Shadows Sub Show()
Console.WriteLine("Calling from C")
End Sub
End Class

Class Test
Public Shared Sub Main()
Dim x As A
x = New A()
x.Show()
x = New B()
x.Show()
x = New C()
x.Show()
End Sub
End Class

End Module

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the features present in vb 2005?

567


What is normal jit?

611


What is the difference between manifest and metadata?

542


What are the different variables in vb.net?

518


Explain convert.tostrin?

626






Explain how can we remove handlers at run time?

545


Tell us how many languages are supported by .net?

504


Explain cts?

528


What is the class that allows an element to be accessed using unique key?

537


thak you Mr Govind for replying to my question. My next question is that how to retrieve image stored in an SQL server table and assign it to any image control or picture control using VB.net

1701


So you know which dll is used for microsoft .net run time?

509


What is late binding?

540


How can we store decimal data in .net?

530


How many ways the function can return values?

525


Explain about rapid application development tool?

512