l2 Object Oriented Programming Inheritance1 0
l2 Object Oriented Programming Inheritance1 0
Programming: Inheritance
Chapter 2
Introduction
Inheritance is a form of software reuse in which a
new class is created quickly and easily by absorbing
an existing class’s members and customizing them
with new or modified capabilities.
With inheritance, you can save time during program
End Class
--------------------
Public Class DerivedClass
Inherits BaseClass
End Class
Person
Example m_Name
SSN
Student
Derived Class Base Class
M_classGroup
Class Student Class Person
Inherits Person Private m_Name As String
Private m_ClassGroup As String Private SSN As Integer
P ublic Sub New(ByVal N As String,
ByVal S As Integer, ByVal G As String ) P ublic Sub New(ByVal N As String,
MyBase.New(N, S) ByVal S As Integer)
m_ClassGroup = G m_Name = N
End Sub SSN = S
End Sub