C++ OOPs Concepts Test 1

    Question 1C++ OOPS - Class Definition

    Which keyword is used to define a class in C++?

    Question 2C++ OOPS - Constructor Naming

    What is the correct naming rule for a constructor in C++?

    Question 3C++ OOPS - Encapsulation Concept

    What is encapsulation in C++?

    Question 4C++ OOPS - Basic Inheritance Concept

    Which keyword is used in C++ to inherit a class?

    Question 5C++ OOPS - Polymorphism Concept

    What does polymorphism mean in C++?

    Question 6C++ OOPS Abstraction Concept

    What is the main purpose of abstraction in C++?

    Question 7C++ OOPS Friend Function Concept

    What is the main purpose of a friend function in C++?

    Question 8C++ OOPS Static Data Member

    Which statement is true about static data members in C++?

    Question 9C++ OOPS Operator Overloading Concept

    Which operators cannot be overloaded in C++?

    Question 10C++ OOPS Virtual Function Concept

    What is a virtual function in C++?

    Question 11C++ OOPS - Object Creation

    Which of the following correctly creates an object of class Car?

    Question 12C++ OOPS - Default Constructor

    Which of the following correctly defines a default constructor?

    Question 13C++ OOPS - Access Modifiers in Encapsulation

    Which access modifier is mainly used to achieve encapsulation in C++?

    Question 14C++ OOPS - Types of Inheritance

    Which of the following is NOT a type of inheritance in C++?

    Question 15C++ OOPS - Compile-time Polymorphism

    Which of the following supports compile-time polymorphism?

    Question 16C++ OOPS Abstract Class

    Which keyword is used to declare a pure virtual function in C++?

    Question 17C++ OOPS Friend Function Syntax

    Which keyword is used to declare a friend function inside a class?

    Question 18C++ OOPS Static Member Function

    Which of the following is true about static member functions?

    Question 19C++ OOPS Operator Overloading Return Type

    What should be the return type when overloading the ++ operator (prefix version)?

    Question 20C++ OOPS Virtual Function Syntax

    Which keyword is used to declare a virtual function in C++?