This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Customer Requirements for Developers and have Marcho Behler on-line!
See this thread for details.
The moose likes Mock Exam Errata and the fly likes inner interface? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Mock Exam Errata
Bookmark "inner interface?" Watch "inner interface?" New topic

inner interface?

jordan gong
Ranch Hand

Joined: Jun 12, 2001
Posts: 37
A top-level interface cannot be private or protected.
Can an inner interface be private or protected?
Jane Griscti
Ranch Hand

Joined: Aug 30, 2000
Posts: 3141
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

Jane Griscti
SCJP, Co-author Mike Meyers' Java 2 Certification Passport
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: inner interface?
It's not a secret anymore!