So here is the case. I have class A and B. Class A has a member in it which is Class B
Public Class A
public _lstB as list (of B)
public sub new()
_lstB = B.Init()
end sub
end Class
Public Class B
public shared sub Init() as list (of B)
....
end sub
End Class
No what I want to do is create a derived class for A and B (lets say DA and DB). I would like the member B to be replace with DB in DA. Is this possible?
Public Class DA
inherits A
public _lstDB as list (of DB)
public sub new()
mybase.new
_lstDB = DB.Init()
end sub
end Class
Public Class DB
inherits B
public shadows shared sub Init() as list (of DB)
....
end sub
End Class
I'm entirely sure this is the way to go, because in the call to
mybase.new
An entire list (of B) is going to be created in the base class that will never endup being used!