answersLogoWhite

0

Static type checking is type checking that can be done at compile time at no runtime cost, as opposed to dynamic type checking which can only be done at runtime. Dynamic type checking is most commonly utilised when you hold a pointer to a base class of a polymorphic type, but where you need to know the actual type at runtime. However, dynamic type checking can largely be avoided by utilising virtual functions to implement a common interface. In this way, you get the correct behaviour without needing to know the actual type. Although virtual functions come with a (small) cost in terms of memory consumption and performance, the cost is trivial compared to dynamic type checking.

User Avatar

Wiki User

7y ago

What else can I help you with?

Related Questions