Classes Objects interview questions – page 2
44 questions. Tap “Show answer” to check yourself.
-
The class body has ___ access specifies.
- 1
- 2
- 3
- 4
Show answer
C. 3
-
The members declared as ____ can only be accessed within the class.
- Private
- Public
- Protected
- Class
Show answer
A. Private
-
Class comprises ____
- Data members
- Member functions
- Both (a) and (b)
- None of these
Show answer
C. Both (a) and (b)
-
When objects of a class are created, separate memory is allocated for?
- Member functions only
- Member variables only
- Both a and b
- Neither functions nor variables
Show answer
B. Member variables only
-
The class access specifier used to access friend function is ____
- Private
- Public
- Protected
- Both (b) and (c)
Show answer
B. Public
-
Which of the following is a user defined data type?
- Protected
- Public
- Object
- Class
Show answer
D. Class
-
The lifetime of a static member variable is same as ___
- Lifetime of the program
- The public variable of any object
- The private of variable of any object
- The first object of its class
Show answer
A. Lifetime of the program
-
Which one of the following language features classes?
- C
- C++
- Basic
- None
Show answer
B. C++
-
The return type of a member function of a class can be ____
- A valid C++ data type or object data type
- Only a valid C++ data type
- Only object data type
- None of the given
Show answer
A. A valid C++ data type or object data type
-
In C++ functions are also called ___
- Definitions
- Concepts
- Methods
- Organizers
Show answer
C. Methods
-
Which of the following is not a valid class specifier?
- Private
- Pointer
- Public
- Protected
Show answer
B. Pointer
-
OOP stands for ___
- Object to Object Programming
- Object Oriented Programming
- Online Objects Programming
- Object Oriented Processes
Show answer
B. Object Oriented Programming
- Advertisement
-
In a class data members are also called as ___
- Abstracts
- Attributes
- Properties
- Dimensions
Show answer
B. Attributes
-
In C++, the class variables are called as ____
- Functions
- Constants
- Objects
- Methods
Show answer
C. Objects