G
Guest
Hi,
I psoted a problem yesterday and I made a typo. I wish I can rephrase the question again correctly today.
Here is the sample code. I got error message: invalid argument of test method.
I also output the type of object e1 with e1.GetType() , and it is Manager.
Can someone give any advice ?
Class Employee
{ .....
}
Class Manager : Employee
{.....
}
public void test(Manager obj)
{.....
}
//Declare a new object.
Employee e1 = new Manager();
//Call test method
test(e1) ;
I psoted a problem yesterday and I made a typo. I wish I can rephrase the question again correctly today.
Here is the sample code. I got error message: invalid argument of test method.
I also output the type of object e1 with e1.GetType() , and it is Manager.
Can someone give any advice ?
Class Employee
{ .....
}
Class Manager : Employee
{.....
}
public void test(Manager obj)
{.....
}
//Declare a new object.
Employee e1 = new Manager();
//Call test method
test(e1) ;