_______ variables of a class are not visible to applications that use the instance of that class.

Hưng Thịnh

New member
_______ variables of a class are not visible to applications that use the instance of that class.
A. Public
B. Private
C. Default
D. Static
 
Answer: B
Explanation: Using OOP terminology, the Public members are “exposed” to the application, whereas the Private members are “hidden” from the application. For an application to assign data to or retrieve data from a Private variable in a class, it must use a Public property. In other words, an application cannot directly refer to a Private variable in a class. Rather, it must refer to the variable indirectly, through the use of a Public property.
 

Tìm kiếm

Back
Top