Multiple choice technology programming languages

Encapsulation is the process of basing one class on another.

  1. True

  2. False

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Encapsulation is the practice of bundling data and methods that operate on that data into a single unit while restricting direct access. The process of basing one class on another is inheritance, not encapsulation, making the statement false.

AI explanation

To answer this question, you need to understand the concept of encapsulation.

Encapsulation is a fundamental principle of object-oriented programming (OOP) that involves bundling data and the methods that operate on that data within a single unit, known as a class. The purpose of encapsulation is to hide the internal details of the object and provide a public interface through which other objects can interact with it.

The statement "Encapsulation is the process of basing one class on another" is incorrect. Encapsulation is not about one class being based on another. It is about combining data and methods into a single unit (class) to achieve data hiding and abstraction.

Therefore, the correct answer is B) False.