hi all,
if I have a class:
CODE
public abstract class Person
{
public string firstname;
public string lastname;
Person(string fname,string lname)
{
firstname=fname;
lastname=lname;
}
}
and I use it like this:
CODE
public class Employee : Person
{
public string ID;
public Employee(string fname,string lname,string
myid):base(fname,lname)
{
ID=myid;
}
}
Now I have a method that I pass the abstract class to
CODE
public void SendingMethod()
{
Employee emp = new Employee("biff","henderson","123");
mymethod(emp);
}
public void mymethod(Person p)
{
//code goes here
}
How do I access the ID on the employee?
I have tried:
p.ID,
(Employee)p.ID
when I watch the variable p i can see that it is of the type Employee
and that the ID is there.
I am sure it is a simple one but I havent used abstraction a lot and am
at a loss as to what to even search for.
Thanks in advance
Bassguy