asked 16.7k views
1 vote
Which of the following are true about Object-Oriented Programming (OOP).

Choose ALL that apply.
A. OOP allows us to define new classes
B. Use of inheritance allows us to reuse code without having to rewrite it
C. A parent class can have at most one child class in Python
D. All methods in the parent class must be overridden by the child class

asked
User Arnorhs
by
8.2k points

1 Answer

3 votes

Final answer:

Object-Oriented Programming allows defining new classes and using inheritance for code reuse. However, a parent class can have multiple child classes, and it is not required to override all methods of the parent class.

Step-by-step explanation:

Object-Oriented Programming (OOP) is a programming paradigm used in software development. When analyzing the given statements about OOP, it can be noted that the following statements are true:

  • OOP allows us to define new classes, enabling programmers to create objects that have attributes and behaviors.
  • Use of inheritance allows us to reuse code without having to rewrite it, by allowing a new class, called a child class, to inherit properties and methods from an existing class, known as the parent class.

However, the given statements that are false include:

  • A parent class can have multiple child classes in Python, not just one.
  • It is not necessary for all methods in the parent class to be overridden by the child class; a child class can inherit methods without modification.

answered
User Ramigg
by
7.1k points