Access Specifiers Mcqs
Our collections of Multiple choice questions and answers focuses on study of Access Specifiers 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 Access Specifiers 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.
Which among the following can be used together in a single class?
Only private
Private and Protected together
Private and Public together
All three together
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
3.
Which among the following can restrict class members to get inherited?
Private
Protected
Public
All three
4.
Which access specifier is used when no access specifier is used with a member of class (java)?
Private
Default
Protected
Public
5.
Which specifier allows a programmer to make the private members which can be inherited?
Private
Default
Protected
Protected and default
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
6.
If a class has all the private members, which specifier will be used for its implicit constructor?
Private
Public
Protected
Default
7.
If class A has add() function with protected access, and few other members in public . Then class B inherits class A privately. Will the user will not be able to call _________ from object of class B.
Any function of class A
The add() function of class A
Any member of class A
Private, protected and public members of class A
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
8.
Which access specifier should be used in a class where the instances can’t be created?
Private default constructor
All private constructors
Only default constructor to be public
Only default constructor to be protected
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
9.
On which specifier’s data, does the size of a class’s object depend?
All the data members are added
Only private members are added
Only public members are added
Only default data members are added
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
10.
If class B inherits class A privately. And class B has a friend function. Will the friend function be able to access the private member of class A?
Yes, because friend function can access all the members
Yes, because friend function is of class B
No, because friend function can only access private members of friend class
No, because friend function can access private member of class A also
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
11.
If an abstract class has all the private members, then _________
No class will be able to implement members of abstract class
Only single inheritance class can implement its members
Only other enclosing classes will be able to implement those members
No class will be able to access those members but can implement.
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
12.
Which access specifier should be used so that all the parent class members can be inherited and accessed from outside the class?
Private
Default or public
Protected or private
Public
13.
Which access specifier is usually used for data members of a class?
Private
Default
Protected
Public
14.
Which specifier should be used for member functions of a class?
Private
Default
Protected
Public
15.
If a function has to be called only by using other member functions of the class, what should be the access specifier used for that function?
Private
Protected
Public
Default