If we have this:
class Car
{
public void mCar()
{
}
}
class Audi : Car
{
public void mAudi()
{
}
}
and in some other class, we have:
Car x = new Audi();
then we only have access to mCar(), but not to mAudi().
My question is, what is the difference between:
Car x = new Audi();
and
Car x = new Car();
The difference is
gives you a new Car object (it knows only of
mCar()), whilegives you a new Audi object, which is also a car object (it knows of
mCar()andmAudi()).