+ 2
A total of how many access modifiers would be
3 ответов
+ 2
Their are 4 access modifiers but we use only 3 i.e public, private,and protected and if we write no access specifiers it means it is friendly
+ 2
No there are only three access modifiers..
Modifiers are of two types :
A. Access modifier B. Nonaccess modifier
access modifier consist of PUBLIC , PRIVATE , PROTECTED which provide us 4 level access control ..if you are thinking default as access modifier then you should know you will get default only when you don't provide any access modifiers
Source OCA/OCP JAVA SE 7 GUIDE BY KATHY.
0
There are 4 types of java access modifiers:
Private: (Access your Data Members and Member Function within Defined Class)
Default: (By Default or Built-in-Access-ability of JAVA )
Protected: (Access your D.Members and M.Function within a Package through Inheritence Only )
Public: (Access your Data Members and Member Function in all parts of your Package and Program. The public access modifier is accessible everywhere. It has the widest scope among all other modifiers.)
There are many non-access modifiers,
i.e
static,
abstract,
synchronized,
native,
volatile,
transient etc