Okay so I will just write some psuedo code here to explain my problem

I have a class named Employee, in which other classes inherit from. It has the following methods which the other classes do not overwrite:

Code:
Pay()
getName()
Now, one of the classes that inherit it (FactoryWorker) creates its own method:

Code:
workOnPart(String PartName)
So in my program, I thought doing this was legal using inheritence:

Code:
Employee myEmployee;
and later on I wanted to dynamically set it to FactoryWorker like so
Code:
myEmployee = new FactoryWorker();
This works, however if I try to access workOnPart() it tells me if could not find the symbol. Is there a way to do it in the same fashion? Obviously my wayy doesnt work. Hopefully it was all legible and makes sense.