T
tshad
If I have the following classes:
public class Person
{
....
public Person()
{
...
}
public Person(int userID)
{
...
}
....
}
public class User : Person
{
....
public User()
{
...
}
public User(int userID)
{
...
}
....
}
In my program I create a User object like so:
Dim user = New User(1)
My problem is that I need to pass the userID which is being passed to User
to Person as well so it can get the Person record using userID as the key.
I would then get the User record also using the userID key.
The problem is that when I do the instantiation, it goes to User and then
directly to Person and its default constructer and not the one with the
userID being passed.
How do I get it to go to the correct constructor using inheritance?
Thanks,
Tom
public class Person
{
....
public Person()
{
...
}
public Person(int userID)
{
...
}
....
}
public class User : Person
{
....
public User()
{
...
}
public User(int userID)
{
...
}
....
}
In my program I create a User object like so:
Dim user = New User(1)
My problem is that I need to pass the userID which is being passed to User
to Person as well so it can get the Person record using userID as the key.
I would then get the User record also using the userID key.
The problem is that when I do the instantiation, it goes to User and then
directly to Person and its default constructer and not the one with the
userID being passed.
How do I get it to go to the correct constructor using inheritance?
Thanks,
Tom