File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A small doubt

 
devika cha
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the default access specifier for a class?
 
raghavendra
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the default access specifier is "friendly"
 
Ajay Kumar
Ranch Hand
Posts: 87
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since "friendly" is not a java keyword, I would say that the default access specifier is "package". I would like to see maha anna's word on it.
Ajay
 
Anonymous
Ranch Hand
Posts: 18944
  • 0
  • send pies
  • Quote
  • Report post to moderator
What is the default access specifier for a class?
There is no no default access specifier ie if you want the class to have default access, then while defining the class, do not precede the class with any(private, protected and public) access modifier.
example:
class Test{}// This class has default access
If the class is having a default access, the class's default feature is accessible to all the classes in the same package but not accessible to classes in the different package, even the subclass in different package cannot access the default feature.
Hope this helps!
 
Anonymous
Ranch Hand
Posts: 18944
  • 0
  • send pies
  • Quote
  • Report post to moderator

....and such classes are known as "friendly" classes
or "package" access classes (as mentioned in the previous
posts). These words are only for refering to the class
by the user community.
As mentioned they are NOT java keywords.
Summing up all the above posts ...

Regds.
- satya
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic