+ 1
dear friends. pleaae give short example to modifyer accesses .
2 ответов
+ 2
there as four access modifier, public and private, default, protected.
default is accessible within the package if you any test package then it will be accessible within it.
public has wider access means within and out of package.
private it's most narrowest access modifier that has access with in the class.
protected has access within the package and out of package to Inherited classes.
public>protected>default>private
+ 2
there are 3types of modifier which are often used public, private, protected
public : in ths type of modifier u can use the variables or methods through the program
protected : the variables and methods declared under this category cannot b used anywhere else in the program...It can b accessed only in block it is declared in
private : the variables and methods declared under these cannot b accessed from another class or program...