• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

java access modifiers

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic