Java Programming: 12 - Packages

Опубликовано: 26 Октябрь 2024
на канале: CodeMonkeyCharlie
127,202
919

In this tutorial, we learn how to create and nest packages. We'll move all of our existing classes into a new package, and use this and other packages in the future to keep our classes organized.

I change to a hierarchical view for packages, but feel free to keep a flat view if you prefer.

I also show how using packages avoids naming conflicts by showing an example of using a fully qualified class name instead of an import.

The default and protected access modifiers are discussed briefly since they deal with package wide access.