Which access specifier is usually used for data members of a class?

Hằng Đoàn

New member
Which access specifier is usually used for data members of a class?
A. Private
B. Default
C. Protected
D. Public
 
Answer: a
Explanation: All the data members should be made private to ensure the highest security of data. In special cases we can use public or protected access, but it is advised to keep the data members private always.
 

Tìm kiếm

Back
Top