Mastering C++: A Comprehensive Quiz Based on 'Thinking in C++

Session length

1 / 805

What programming principle allows the easy addition of new types without changing existing code?

Type safety

Polymorphism

Polymorphism is used to allow objects of different types to be treated in a consistent manner, allowing for the addition of new types without having to modify existing code. Type safety, also known as static typing, is a programming principle that ensures variables are assigned the appropriate type before they are used. Early binding and late binding are both forms of polymorphism, but early binding requires the type of an object to be determined at compile time, while late binding defers the assignment of type until runtime. These principles are not as effective as polymorphism in allowing for the easy addition of new types without modifying existing code.

Get further explanation with Examzify DeepDiveBeta

Early binding

Late binding

Next Question
Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy