Home Subjects C++ Programming

C++ Programming

Object oriented C++ for GATE and placement

28 Q 1 Topics Take Mock Test
Advertisement
Difficulty: All Easy Medium Hard 1–10 of 28
Topics in C++ Programming
All OOP Concepts 100
Q.1 Easy OOP Concepts
A pure virtual function is declared using which syntax in C++?
A virtual void func() = 0;
B abstract void func();
C pure virtual void func();
D virtual abstract void func() = 0;
Correct Answer:  A. virtual void func() = 0;
EXPLANATION

In C++, a pure virtual function is declared by adding '= 0' after the function signature. C++ does not have 'abstract' or 'pure' keywords like Java.

Test
Q.2 Easy OOP Concepts
Which type of inheritance allows multiple classes to inherit from a single base class?
A Multilevel Inheritance
B Hierarchical Inheritance
C Multiple Inheritance
D Hybrid Inheritance
Correct Answer:  B. Hierarchical Inheritance
EXPLANATION

Hierarchical inheritance occurs when one base class is inherited by multiple derived classes. Multiple inheritance is when one class inherits from multiple base classes.

Test
Q.3 Easy OOP Concepts
A class member declared as 'private' can be accessed by:
A Any external class or function
B Only member functions of the same class and friend functions
C Derived classes
D Any derived class and external functions
Correct Answer:  B. Only member functions of the same class and friend functions
EXPLANATION

Private members are accessible only within the class itself and to friend functions/classes. They are not accessible to derived classes or external code.

Test
Q.4 Easy OOP Concepts
Which access specifier should be used when a derived class needs to access a base class member but external classes should not?
A public
B private
C protected
D internal
Correct Answer:  C. protected
EXPLANATION

The 'protected' access specifier allows derived classes to access the member while keeping it hidden from external classes. This provides the needed balance for inheritance hierarchies.

Test
Q.5 Easy OOP Concepts
What is the significance of the 'this' pointer in C++?
A It points to the class definition
B It points to the current object for which the member function is called
C It points to the parent class object
D It is used to declare static members
Correct Answer:  B. It points to the current object for which the member function is called
EXPLANATION

The 'this' pointer is an implicit pointer that points to the current object instance. It is used to access members of the current object and to return a reference to the current object.

Test
Q.6 Easy OOP Concepts
Which of the following best describes the concept of function overloading?
A Multiple functions with the same name but different return types
B Multiple functions with the same name but different parameter lists
C Multiple functions with different names but same parameters
D Multiple functions defined in different files with the same name
Correct Answer:  B. Multiple functions with the same name but different parameter lists
EXPLANATION

Function overloading allows multiple functions to have the same name as long as they differ in number, type, or order of parameters. Return type alone is not sufficient.

Test
Q.7 Easy OOP Concepts
Which C++ feature allows a function to work with objects of different types through a common interface?
A Encapsulation
B Polymorphism
C Aggregation
D Modularity
Correct Answer:  B. Polymorphism
EXPLANATION

Polymorphism enables a function to work with objects of different types through a common base class interface, providing flexibility and extensibility.

Test
Q.8 Easy OOP Concepts
What does polymorphism literally mean?
A One form
B Many forms
C Multiple inheritance
D Method hiding
Correct Answer:  B. Many forms
EXPLANATION

'Poly' means many and 'morph' means form. Polymorphism allows objects to take many forms through method overloading and overriding.

Test
Q.9 Easy OOP Concepts
In C++, when a derived class object is created, which constructor is called first?
A Derived class constructor
B Base class constructor
C Both simultaneously
D Default constructor
Correct Answer:  B. Base class constructor
EXPLANATION

The base class constructor is always called before the derived class constructor to ensure proper initialization of inherited members.

Test
Q.10 Easy OOP Concepts
What is the access specifier for class members that are accessible only within the same class?
A public
B protected
C private
D internal
Correct Answer:  C. private
EXPLANATION

Private members are accessible only within the same class. Public members are accessible from anywhere, and protected members are accessible in derived classes.

Test

About C++ Programming Practice on iGET

iGET offers 28+ free C++ Programming MCQ questions covering all important topics. Each question is prepared by subject experts and comes with detailed explanations to help you understand concepts deeply, not just memorize answers.

Why prepare with iGET?

100% free access, timed mock tests, instant results with detailed analysis, topic-wise progress tracking, and bookmark feature for revision. Trusted by thousands of aspirants preparing for UPSC, SSC, Bank, Railway, NEET, JEE and other competitive exams across India.

How to use this page effectively

Start by selecting a difficulty level (Easy / Medium / Hard) or pick a specific topic from the topics strip. Attempt questions, check your answer instantly, read the explanation carefully, and bookmark tricky ones for later revision. For full exam-style practice, take a Mock Test from the right sidebar.

IGET
IGET AI
Online · Exam prep assistant
Hi! 👋 I'm your iget AI assistant.

Ask me anything about exam prep, MCQ solutions, study tips, or strategies! 🎯
UPSC strategy SSC CGL syllabus Improve aptitude NEET Biology tips