Design decisions: Why and when to make an interface private?
问题 Are private interfaces ever used in design decisions ? If so, what are the reasons and when do you know the need for a private interface? 回答1: A top-level interface cannot be private. It can only have public or package access. From the Java Language Specification, section 9.1.1: "Interface Modifiers": The access modifiers protected and private pertain only to member interfaces whose declarations are directly enclosed by a class declaration (§8.5.1). A nested interface can be private whenever