A class Car and its subclass ElectricCar both have a method accelerate() which was written by the programmer as part of the class definition. If TeslaModelS refers to an object of type ElectricCar, what will the following code do?
A.TeslaModelS.accelerate();
B. The accelerate() method defined in ElectricCar will be called.
C. The accelerate() method defined in Car will be called.
D. The compiler will complain that accelerate() has been defined twice.
Overloading will be used to pick which accelerate() is called.