Which header file is required in C++ to use OOP?

Options

  • A. OOP can be used without using any header file
  • B. stdlib.h
  • C. stdio.h
  • D. Encapsulation and Inheritance

Correct Answer (Detailed Explanation is Below)

A. OOP can be used without using any header file

Detailed Explanation

Explanation:

In C++, Object-Oriented Programming (OOP) concepts like:

  • Classes

  • Objects

  • Inheritance

  • Polymorphism

  • Encapsulation

are built into the language itself.

You do not need any specific header file to use OOP features.

Header files like:

  • iostream → For input/output

  • stdlib.h → For general utilities

  • stdio.h → C-style input/output

are unrelated to enabling OOP.

OOps! You are currently offline.