In context of OO programming, explain which is polymorphism, inheritance, and encapsulation.
Utilisateur anonyme
Polymorphism – means the ability of a single variable of a given type to be used to reference objects of different types, and automatically call the method that is specific to the type of object the variable references. Inheritance – is the inclusion of behavior (i.e. methods) and state (i.e. variables) of a base class in a derived class so that they are accessible in that derived class. Encapsulation – refers to keeping all the related members (variables and methods) together in an object.