Search⌘ K

Limitations of Type Hinting for Objects

Learn about the limitations of object type hinting.

We'll cover the following...

Limitations of object type hinting

Let’s consider a scenario. A manager at a car rental company that rents only BMWs hires a programmer to write a program that calculates the price for a full tank of gas for each and every car that the company owns. In accordance with these demands, the programmer writes a class Bmw that holds the code for this task. This class has the relevant data about the BMWs, including the license plate number, car model, and most importantly, a ...