[JAVA rookie] ask questions about JAVA import package

questions are as follows:

clipboard.png

Option B, which says that a JAVA source file can have multiple package declaration statements, is wrong. A little do not understand, a class can import a lot of packages, why only 1 declaration statement?

Apr.02,2021

package declaration, not package import.


The

package import declaration indicates that the java class needs to reference other classes, and a java class may reference multiple other classes, which may be in different packages and require multiple package declaration imports.

package declaration is a namespace, reflecting that the file system is a directory hierarchy, the same java source file can only have one package declaration, and the same java source file can only be in one directory.

if you think about it, if you can have multiple package declarations, this is equivalent to the same java source file can be in different directories. How is that possible?

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3aa53-2c235.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3aa53-2c235.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?