Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

java access modifiers  RSS feed

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone!!
I have got a very basic doubts.
1. what is the difference between public and default modifiers.
2. what are access specifiers.Access modifiers are:
public,private,default,protected,abstract,final,static,synchronize,transient and native.
But what are access specifiers.Are both(modifiers and specifiers) same?
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To declare public means to give access to all classes, default access modifier limits access to inner classes, and subclasses.
 
Ranch Hand
Posts: 396
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ml,
public access -
class can be accessed by any other class.
default access -
class can be accessed/used only inside the package in which it is defined

Now
public,private,default,protected,abstract,final,static,synchronize,transient and native .... all these metioned by u are called modifiers.
but out of these only public/protected/private are known as access modifiers/access specifiers.rest are simply modifiers.
regards
Deekasha
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!