C++ OOPs Concepts Test 1

    Question 1: C++ OOPS - Class Definition

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

    Question 2: C++ OOPS - Constructor Naming

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

    Question 3: C++ OOPS - Encapsulation Concept

    What is encapsulation in C++?

    Question 4: C++ OOPS - Basic Inheritance Concept

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

    Question 5: C++ OOPS - Polymorphism Concept

    What does polymorphism mean in C++?

    Question 6: C++ OOPS Abstraction Concept

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

    Question 7: C++ OOPS Friend Function Concept

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

    Question 8: C++ OOPS Static Data Member

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

    Question 9: C++ OOPS Operator Overloading Concept

    Which operators cannot be overloaded in C++?

    Question 10: C++ OOPS Virtual Function Concept

    What is a virtual function in C++?

    Question 11: C++ OOPS - Object Creation

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

    Question 12: C++ OOPS - Default Constructor

    Which of the following correctly defines a default constructor?

    Question 13: C++ OOPS - Access Modifiers in Encapsulation

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

    Question 14: C++ OOPS - Types of Inheritance

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

    Question 15: C++ OOPS - Compile-time Polymorphism

    Which of the following supports compile-time polymorphism?

    Question 16: C++ OOPS Abstract Class

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

    Question 17: C++ OOPS Friend Function Syntax

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

    Question 18: C++ OOPS Static Member Function

    Which of the following is true about static member functions?

    Question 19: C++ OOPS Operator Overloading Return Type

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

    Question 20: C++ OOPS Virtual Function Syntax

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