I think what you are asking is regarding polymorphous assigning in Java. A very good example that I've heard goes a little something like this:
Say for example you need to generate a payroll for every type of employee in your organization. Without polymorphism, it would be that you would need to have a function for every type of Employee in the organization. For example:
For every Manager, you would need
public void generatePayroll(Manager manager)
For an Account employee, you would need
public void generatePayroll(Accountant accountant)
So then, you would almost immediately realize that you would be doing some tedious work by applying functionality of generating a payroll to every Employee. Instead, (and thank God for polymorphism), you can have a single method which then just takes in an Employee type since both Accountant and Manager both extend the Employee class. The signature would then change as such:
public void generatePayroll(Employee employee)
That way, you will be able to eliminate the need for having a generatePayroll method for every Employee level, and just stick to this one! (Remember, DRY is best!)