Examveda

What is the difference between class composition and class inheritance?

A. Composition allows creating new classes

B. Inheritance allows creating new classes

C. Composition involves using existing classes

D. Inheritance involves using existing classes

Answer: Option C

Solution (By Examveda Team)

Class composition involves using existing classes to build more complex ones, while inheritance involves creating new classes based on existing ones.

This Question Belongs to Python Program >> Advanced OOP Concepts

Join The Discussion

Related Questions on Advanced OOP Concepts

What is inheritance in OOP?

A. Creating new objects from existing ones

B. Allowing objects to share attributes and methods

C. Restricting access to object attributes

D. Converting classes into objects