| Author |
Access modifiers and access control
|
Rohan Deshmkh
Ranch Hand
Joined: Aug 31, 2012
Posts: 127
|
|
As per the book "Sun Certified Programmer for Java 6" By Kathy Sierra and Bert Bates , Chapter 1 , page12
There are 4 access control namely: public , private, protected and default . But there are only 3 access modifiers namely: public,private and protected.
So my question is why is it so?What's the difference between access control and access modifiers?
After going through this forum i also assume that there is no such thing as access specifier in java(if you search for specifier in jls, there is nothing about specifier in jls document).
|
 |
Winston Gutkowski
Bartender
Joined: Mar 17, 2011
Posts: 4901
|
|
Rohan Deshmkh wrote:So my question is why is it so?What's the difference between access control and access modifiers?
'access control' is what it does; 'access modifier' is how you write it. The "default" access (sometimes called 'package private') is what you get when you don't specify a modifier.
Winston
|
Isn't it funny how there's always time and money enough to do it WRONG?
|
 |
gurpeet singh
Ranch Hand
Joined: Apr 04, 2012
Posts: 892
|
|
|
some books call access modifiers as access specifier also. there is no naming convention regarding them in jls. use access specifier or access modifier that does not make difference . both are synonyms. access control is as Winston said what THESE modifiers do. they provide access control.
|
OCPJP 6(100 %) OCEWCD 6(91 %)
|
 |
Rohan Deshmkh
Ranch Hand
Joined: Aug 31, 2012
Posts: 127
|
|
|
Ok thanks, i got it.
|
 |
 |
|
|
subject: Access modifiers and access control
|
|
|