C# Tutorials and offshore development in India
Tutorials Resources Forum Reviews Communities Interview Jobs Projects Training Your Ad Here


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Code Snippets » Console Applications »

shadows


Posted Date: 19 Oct 2009    Resource Type: Code Snippets    Category: Console Applications
Author: krishnavenikaladiMember Level: Gold    
Rating: 1 out of 5Points: 7



shadows:it is a keyword used in derived class which is used to shadow the method defined in base class.suppose if we want to get the method invoked from base class it has to be done with following steps:
-->define base class variable
--->define object for the derived class
-->assign the object of derived class to base class variable

//defines base class
Public Class parent
//define method
Public Overridable Sub display()
System.Console.WriteLine("from parent...")

End Sub
End Class
//define derived class
Public Class child
Inherits parent
//shadowing method.....
Public Shadows Sub display()
System.Console.WriteLine("from child....")

End Sub
End Class

Module Module3
Sub main()
//defining base class variavle
Dim p As parent
//instantiating derived class & assigning to base clas variable
p = New child
//invoking method
p.display()

End Sub
End Module






Responses to the resource: "shadows "

No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
Overridable  .  Shadows  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: using threadpool
Previous Resource: Hashtable
Return to Discussion Resource Index
Post New Resource
Category: Console Applications


Post resources and earn money!
 
More Resources




About Us    Contact Us    Privacy Policy    Terms Of Use