And the question is what kind of import should be inserted in package pack2 so that it compiles. One of the answer is to use a static import like this:
And as it is written in the book: "You can do a static import on static object references, constants and static methods."
And thus why this import is legal? enum is none of the above cases.
Jan Osykowski wrote:And as it is written in the book: "You can do a static import on static object references, constants and static methods."
The book was wrong here. Or rather, incomplete. Static nested types should have been included on the list. Or just refer to them all as static members, as AK just did.