ENCAPSULATION Flashcards
access specifier provides access to the data members, and the data methods limit to the class itself.
Private
access specifier provides the access specifications to a class so that it can be accessed from anywhere within the program.
Public
is the first line of data hiding. If any class in Java is not mentioned with an access specifier, then the compiler will set as the access specifier.
Default
a class’s variables are hidden from other classes and can only be accessed by the methods of the class in which they are found.
Encapsulation
It is done in the form of a secure field accessible by only the members of the same class.
Encapsulation
Powerful mechanism for storing the data members and data methods of a class together.
Encapsulation
access specifier protects the class methods and members similar to the private access specifier.
Protected