K
Kishor
Hi,
I am looking for the solution to my problem. this is related to inheritance
(Inheriting properties of base class in multiple quantity) . I am writing
code in VB.net language, I am having two classes clsVehicle and clsWheel.
clsWheel has two properties diameter and pressure. clsVehicle has two
properties Name and Make. I want to implement these classes this way
create a object of Vehicle class.
dim Ovehicle as New clsVehicle
Now I want to have a statements like this
implementation code.
Ovehicle.name = "VehicleName"
Ovehicle.make= "VehicleMake"
Ovehicle.wheels.count = 4
Ovehicle.wheel(1).diameter = "100"
Ovehicle.wheel(2).diameter = "100"
Ovehicle.wheel(3).diameter = "100"
Ovehicle.wheel(4).diameter = "100"
What are the properties and other code has to be implemented in these
classes so that I can have all these above statements valid. Can any one
help me writing this code. I am here pasting the code of the class. I have
tried using parameterized properties but I failed. I tried using this
statement inherits clsWheel in cls Vehicle. I also tried creating instance
of clswheel in clsVehicle dim owheel() as clswheel.
Please guide me to achieve this
Public Class clsVehicle
Private mname As String
Private mmake As String
Public Property name() As String
Get
Return mname
End Get
Set(ByVal Value As String)
mname = Value
End Set
End Property
Public Property Make() As String
Get
Return mmake
End Get
Set(ByVal Value As String)
mmake = Value
End Set
End Property
End Class
Public Class clsWheels
Private mDiam As String
Private mpressure As String
Public Property Diameter() As String
Get
Return mDiam
End Get
Set(ByVal Value As String)
mDiam = Value
End Set
End Property
Public Property pressure() As String
Get
Return mpressure
End Get
Set(ByVal Value As String)
mpressure = Value
End Set
End Property
End Class
Tia,
Kishor
I am looking for the solution to my problem. this is related to inheritance
(Inheriting properties of base class in multiple quantity) . I am writing
code in VB.net language, I am having two classes clsVehicle and clsWheel.
clsWheel has two properties diameter and pressure. clsVehicle has two
properties Name and Make. I want to implement these classes this way
create a object of Vehicle class.
dim Ovehicle as New clsVehicle
Now I want to have a statements like this
implementation code.
Ovehicle.name = "VehicleName"
Ovehicle.make= "VehicleMake"
Ovehicle.wheels.count = 4
Ovehicle.wheel(1).diameter = "100"
Ovehicle.wheel(2).diameter = "100"
Ovehicle.wheel(3).diameter = "100"
Ovehicle.wheel(4).diameter = "100"
What are the properties and other code has to be implemented in these
classes so that I can have all these above statements valid. Can any one
help me writing this code. I am here pasting the code of the class. I have
tried using parameterized properties but I failed. I tried using this
statement inherits clsWheel in cls Vehicle. I also tried creating instance
of clswheel in clsVehicle dim owheel() as clswheel.
Please guide me to achieve this
Public Class clsVehicle
Private mname As String
Private mmake As String
Public Property name() As String
Get
Return mname
End Get
Set(ByVal Value As String)
mname = Value
End Set
End Property
Public Property Make() As String
Get
Return mmake
End Get
Set(ByVal Value As String)
mmake = Value
End Set
End Property
End Class
Public Class clsWheels
Private mDiam As String
Private mpressure As String
Public Property Diameter() As String
Get
Return mDiam
End Get
Set(ByVal Value As String)
mDiam = Value
End Set
End Property
Public Property pressure() As String
Get
Return mpressure
End Get
Set(ByVal Value As String)
mpressure = Value
End Set
End Property
End Class
Tia,
Kishor