Classes and Objects Important Questions | Class 12

Chapter 3 - Classes and Objects in C++

This page contains important questions on Classes and Objects in C++ for Class 12 Computer Science. These questions are useful for ASSEB / AHSEC Class 12 exam preparation

1. What is a class?

Answer :A class is a user-defined data type that groups together data members and member functions.It acts like a blueprint or design for creating objects

2. What is an object?

Answer : An object is an instance of a class.

3. What are class members?

Answer : The elements declared inside a class are called members of the class or class members. 

It includes – data members and member functions.

4. What are data members?

Answer : The variables declared inside a class are called data members.They represent the characteristics or properties of an object.

5. What are member functions?

Answer : Functions declared inside a class are called member functions.They are used to perform operations on the data members of the class.

6. What are access specifiers?

Answer : Access specifiers help us control the visibility of class members. There are 3 access specifiers- private, protected and public

7. What are private members?

Answer : A member declared as private can normally be accessed only by the member functions of the same class

8.What are protected members?

Answer : A protected member is similar to a private member in that it cannot normally be accessed directly from outside the class. However, the difference is that protected members can also be accessed by derived classes.

9. What are public members?

Answer : Members declared as public can be accessed both inside the class and from outside the class using an object

10. What is scope resolution operator?

Answer :

The scope resolution operator is used to specify the scope to which a member belongs. It is used to specify the class to which a member function belongs

ClassName::functionName()

11.What is pass-by-value?

Answer : When an object is passed by value, a copy of the object is passed to the function. Changes made to the parameter inside the function do not change the original object.

12.What is pass-by-reference?

Answer : When an object is passed by reference, a reference to the original object is passed Changes made inside the function affect the original object

13. What are static class members?

Answer: Normally, each object has its own copy of non-static data members. Sometimes, however, we want a particular piece of data to be shared by all objects of a class. For this purpose, C++ provides static members.

Static class members are mainly of two types:

  • Static data members
  • Static member functions
Scroll to Top