Class Members Mcqs
Our collections of Multiple choice questions and answers focuses on study of Class Members in OOP. These questions are chosen from a collection of most authoritative and best reference books on OOP. Our aim is to prepare an individual for competitive exams like NTS, Web Developer | IOS Developer | Game Developer | Software House interviews and jobs, University and College entrance exams and various tests and job interviews. One should practice our Mcqs to assimilate Class Members in OOP comprehensively.
Object Oriented Programming Mcqs
- Access Specifiers Mcqs
- Builtin Classes Mcqs
- Class Members Mcqs
- Concept and Features Mcqs
- Constructors and Destructors Mcqs
- Exception Handling Mcqs
- Inheritance and its Types Mcqs
- Member Functions Mcqs
- Memory Allocation and Variable Scope Mcqs
- Objects and Classes Mcqs
- Objects and Pointers Mcqs
- Overloading Mcqs
Computer MCQS
Sciences MCQS
2.
Data members ________________ (C++)
Can be initialized with declaration in classes
Can be initialized only with help of constructors
Can be initialized either in declaration or by constructor
Can’t be initialized
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
3.
Which among the following is true for data members?
Private data members can be initialized with declaration in class
Static members are initialized in constructors
Protected data members can be initialized in class directly
Static data members are defined outside class, not in constructor
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
4.
What should be done for data member to be of user defined structure type?
The structure must have been defined before class.
The structure must have been defined after the class definition
The structure must be predefined
The structure type data members can’t be used
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
5.
How many data members can a class contain?
27
255
1024
As many as required
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
6.
How to access data members of a class?
Dot operator
Arrow operator
Dot or arrow as required
Dot, arrow or direct call
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
7.
To create a pointer to a private data member of a class, outside the class, which among the following is correct?
Return the address of the private data member using a member function
Access the private member using a pointer outside class
Declare the member as pointer inside the class
Not possible to create pointer to a private member
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
8.
Which among the following is true for use of setter() and getter() function?
Considered best for manipulating data values
Considered the only proper way to manipulate the values
Considered specially for private members manipulation
Considered a red flag, and not recommended for large scale use
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
10.
The static member functions can only use ________
Static data members
Private data members
Protected data members
Constant data members
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
11.
What is the keyword used to make data members have same value?
Static
Const
Double
Abstract
12.
Which data members can be inherited but are private to a class?
Private
Protected
Protected and Static
Privately inherited
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
13.
Which among the following is not allowed for data member declaration?
Int a,
Static int a,
Abstract a,
Boolean a,
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
14.
Which among the following best describes member functions?
Functions which are defined within the class
Functions belonging a class
Functions in public access of a class
Functions which are private to class
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
15.
How many types of member functions are generally there in C++?
2
3
4
5
16.
How can a static member function be called in main function?
Using dot operator
Using arrow operator
Using dot or arrow operator
Using dot, arrow or using scope resolution operator with class name
Answer & Solution
No Solution for this Answer..! Report or Discus this Question