In one of the Java books I am reading/experimenting with, it states that "interfaces can have acces modifiers of pulic or blank, similar to classes." My question is why can't that list include protected? An interface can be extended which in my mind, means that protected would be valid as well if you want to control what classes/other interfaces have access to it. Am I reading into the statement too much that protected is not allowed or is it just that it was not mentioned in the statement specifically?
Originally posted by Chris Allen: My question is why can't that list include protected?
Top-level classes can't be protected, only methods can be, and interfaces are no different. All the methods in an interface are always implicitly public; the interface itself can be public or not, just like a class.