• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Access modifiers and access control

 
Rohan Deshmkh
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 10259
59
Eclipse IDE Hibernate Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
gurpeet singh
Ranch Hand
Posts: 924
1
Fedora Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Rohan Deshmkh
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok thanks, i got it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic