packages
7 tutorials tagged “packages”.
- Access Modifiers in Javaprivate, package-private, protected and public: who can reach a class, field or method, the protected subclass rule, and the errors across packages.
- Import Statements in JavaUse classes from other packages by short name: single-type and wildcard imports, fully qualified names, name clashes, and what import does not do.
- Classpath in JavaThe list of places where Java looks for classes: setting it with -cp, folders and JAR files, the search order, CLASSPATH, and class-not-found errors.
- Packages in JavaPackages group related classes and give them unique names: built-in packages, writing your own, the folder layout, compiling with -d and running by full name.
- Module Import Declarations (Java 25)import module java.base; brings in every package a module exports in one line. How it works, resolving name clashes, and when to use it.
- Package Naming and Folder StructureHow to name packages (reverse domain, lowercase, no hyphens), how names map to folders, a standard project layout, and the errors when they don't match.
- Static Import in JavaUse static fields and methods without the class name: import static syntax, good uses such as constants and test assertions, ambiguity, and overuse.