Among the following, which statement is correct about Modularity?

2025

Among the following, which statement is correct about Modularity?

  1. A.

    Modularity means hiding the parts of the program

  2. B.

    Modularity refers to dividing a program into smaller modules or independent parts

  3. C.

    It refers to overloading the program's part

  4. D.

    Modularity refers to wrapping the data and its functionality into a single entity

Attempted by 7 students.

Show answer & explanation

Correct answer: B

Modularity is a core software-design principle: a large program is decomposed into a set of smaller, independent modules (functions, classes, or components), each responsible for one well-defined piece of functionality and communicating with the others through defined interfaces. This decomposition makes a system easier to develop in parallel, test in isolation, understand, and maintain — and it is distinct from related but different ideas such as information hiding (concealing a module's internal details) and encapsulation (bundling data with the operations on that data).

Matching the options against this definition: the statement describing modularity as dividing a program into smaller modules or independent parts is exactly this decomposition principle, so it is the statement that correctly describes modularity.

  • Describing modularity as hiding parts of the program is actually the definition of information hiding — concealing a module's internal implementation details behind its interface — not the act of splitting the program into modules.

  • Describing modularity as overloading a program's part refers to a completely different, unrelated OOP feature (giving a function or operator multiple behaviours), and has nothing to do with decomposing a system into modules.

  • Describing modularity as wrapping data and its functionality into a single entity is the definition of encapsulation (bundling state and behaviour into one unit, e.g. a class or object) — a related but distinct design concept from breaking a system into independent modules.

Hence, the statement that correctly captures Modularity is the one describing division of a program into small, independent modules.

Explore the full course: Computer Science

Loading lesson…