• 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:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

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
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!