• Post Reply Bookmark Topic Watch Topic
  • New Topic

inner interface?

 
jordan gong
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A top-level interface cannot be private or protected.
Can an inner interface be private or protected?
Thanks.
 
Jane Griscti
Ranch Hand
Posts: 3141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jordan,
An interface declared within a class can be 'private' or 'protected'. You cannot declare an 'inner interface' in an interface declaration.

Remember that all interface members are implicitly 'public', making it impossible to declare an interface inside an interface as 'private or protected'
Hope that helps.
------------------
Jane Griscti
Sun Certified Programmer for the Java� 2 Platform
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!