Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Interface Implementation

 
phanikumar denduluri
Greenhorn
Posts: 1
  • 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
  • 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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree with Manish.
Regards
Maulin
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic