Final answer:
In the context of Java packages, only statement II is correct as packages do provide a visibility control mechanism. Statements I, III, and IV are incorrect regarding partitioning class names, package accessibility by external code, and the storage of package .class files, respectively.
Step-by-step explanation:
The question asks about the properties of Java packages and which statements are correct regarding their attributes. Let's go through each statement:
- Statement I is incorrect. Packages in Java do indeed provide a mechanism that helps partition classes into manageable chunks, helping to organize classes and interfaces.
- Statement II is correct. Packages provide a visibility control mechanism through access modifiers such as public, protected, and default (package-private), which can be used to control whether classes in other packages can access certain classes and members.
- Statement III is incorrect. Not all classes defined within a package are accessible by code outside that package. Whether they are accessible depends on the access modifiers applied to them.
- Statement IV is incorrect. The .class files for classes declared to be part of a package must be stored in a directory structure that matches the package structure. It's not permissible to store .class files for the same package in multiple directories.
So, from the given options, (b) Only (II) above is the correct answer.