Question
Easy

The keywords private, protected and public may appear _______ in the declaration of a class in C++.

1
in any order and any number of times
2
at the most one time and in any order
3
at the most one time and strictly in the order
4
any number of times but strictly in the order
Question Details
Time to Solve: 12
Exam: HTET
Level/Paper: Level 3
Chapter: Object-Oriented Programming (C++)
Topic: Class & Object in C++
Correct Answer
Option A
Explanation

The correct option is (1): In C++, the keywords private, protected, and public are known as access specifiers, and they are used to control the visibility and accessibility of a class's members (data and functions). A fundamental design feature of C++ is that these access specifiers are declarative region markers rather than fixed, singular settings. Consequently, you are permitted to use any of these keywords in any order within the…Read More