I'm learning about Java and have just encountered 2 instructions:
Ask:
Should in (2) LIKE or DIFFERENT Must in (1) ?? -> (1), (2).
What is correct ??
As mentioned in the comments, this is not as clear as it might seem at first, partly because the JLS does not require packages to be stored in a file system:
7.6. Top Level Type Declarations :
If and only if packages are stored in a file system (§7.2), the host system may choose to enforce the restriction that it is a compile-time error if a type is not found in a file under a name composed of the type name plus an extension (such as .java or .jav) if either of the following is true:
[...]
So your answer is basically:
It may be a "must", depending on your compiler.