Professional Documents
Culture Documents
VB Day 4
VB Day 4
VB Day 4
myProperty() Public
myProperty()
Syntax for Inherit a Class
• Class derivedclassName
inherits baseclassName
member(s) / ‘statements
end class
• 2nd syntax
class derivedclassName : inherits baseclassName
(this should be in the same line)
member(s) / ‘statements
end class
{see example}
Method Overriding
• When ever the base class members
definitions are modified at the derived class
then it is said to be method overriding.
• [or in another words] like if I have a
definitions in base and I am changing it in
the modifying it is derived class then this is
called as method overriding.
Points to remember for method
overriding
• In order to override a method definition at the
derived class it should be prefixed with
“overrides” keyword.
• If a method is prefixed with overrides keyword at
the derived class then it is a mandatory to define
that method using “overriadable” keyword at the
base class.
• If a method is prefixed with “overriadable”
keyword at the base class it is not mandatory to
redefine that method from the derived class.
SHADOWING
• It is used to shadow the method definitions specified at the derived
class.Such that the definitions specified at the base class can be used.
Parents
Children