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

Interface Implementation

 
phanikumar denduluri
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can an interfaec be implemented outside a package. This is because we cannot specify access modifier to an interface. please answer my question
 
M Sharma
Ranch Hand
Posts: 106
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi phanikumar,
I think we can specify an access modifier for an interface.
Only public and default access modifier are allowed for an interface.
If you wish to access the interface outside the package declare it as public interface and if you do not wish to access interface outside the package then do not specify any modifier (default) while declaring it. default access modifier will only make it available to the current package.
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree with Manish.
Regards
Maulin
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic