Using access control you can control what parts of a program can access the members of a class (i.e. instance variable and methods).
By controlling access, you can prevent misuse. For example, allowing access to data only through a well defined set of methods, you can prevent misuse of that data.
However access control to instance variables and methods of a class is determined by access specifier.
Java’s access specifier’s are:
View original post 588 more words