What's the point of package modifiers?
问题 I don't understand package modifiers (not annotations) like this: public package foo; public class Bar { } Do they have any meaning? 回答1: The only type of package modifier in the JLS is an annotation. From JLS 7.4.1: PackageDeclaration: {PackageModifier} package Identifier {. Identifier} ; PackageModifier: Annotation So public package foo; is invalid syntax. This compiles under some versions of Eclipse, due to a bug which has been fixed in some conditions, and will be fixed in all conditions