+ 2

A total of how many access modifiers would be

1st Aug 2016, 3:54 AM
Anirudh Ac
Anirudh Ac - avatar
3 Antworten
+ 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
5th Aug 2016, 11:00 AM
Aditya
Aditya - avatar
+ 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.
15th Aug 2016, 12:46 PM
Abhishek C Prajapati
Abhishek C Prajapati - avatar
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
29th May 2017, 1:11 AM
Kyaw Phyo Aung
Kyaw Phyo Aung - avatar