Classes and Objects in C++ Programming Questions and Answers - 3
Question: 11
Data hiding refers to _____
(A) not giving names to data
(B) not specifying members and functions of a class
(C) declaring members as public
(D) members and functions of a class are not accessible by members of outside class
Ans: D
members and functions of a class are not accessible by members of outside class
Question: 12
The class members declared _____ can be accessed only within the class and the members of the inherited classes.
(A) protected
(B) unprotected
(C) public
(D) private
Ans: A
protected
Question: 13
Declaration of class member are declared as private can be accessed only
(A) separately in another class
(B) inside or outside the class
(C) outside the class
(D) within class
Ans: D
within class
Question: 14
The private data of a class can be accessed
(A) only by member functions of its own class and friend functions
(B) only by member functions of its own class
(C) only by friend functions
(D) by any function
Ans: A
only by member functions of its own class and friend functions
Question: 15
The member functions declared under which scope can be accessed by the objects.
(A) protected
(B) global
(C) private
(D) public
Ans: C
private
GATE Chemical Engineering Questions and Answers More
GATE 2024-2025 Question Paper Pdf Download More
Banking Awareness Questions 2024-2025 More
Computer Quiz Questions for Bank Exams More
Computer Quiz Questions for Bank Exams More
7000+ English Grammar Quiz for Bank Exams 2024 - 2025 More
Hydrosphere Online Test | GK Questions and Answers More
Delhi Sultanate Quiz Questions and Answers More
Top 150+ MS Windows Quiz Questions with Answers 2020-2021 More
100+ Boats and Streams Questions for Bank PO, SO, Clerk Exams More