in JAVA by
What are the various access specifiers for Java classes?

1 Answer

0 votes
by

In Java, access specifiers are the keywords used before a class name which defines the access scope. The types of access specifiers for classes are:

1. Public : Class,Method,Field is accessible from anywhere.

2. Protected:Method,Field can be accessed from the same class to which they belong or from the sub-classes,and from the class of same package,but not from outside.

3. Default: Method,Field,class can be accessed only from the same package and not from outside of it’s native package.

4. Private: Method,Field can be accessed from the same class to which they belong.

Related questions

+1 vote
0 votes
asked May 24, 2020 in Python by SakshiSharma
0 votes
asked May 30, 2020 in JAVA by Robindeniel
0 votes
asked May 18, 2020 in JAVA by AdilsonLima
...