Your computer contains thousands if not millions of files. These files are organized throughout folders (directories) and sub-folders (sub-directories). Can you imagine the mess if there were no such thing as folders and we had to have all of our files located on the root of our drive? Each file name must be unique, so we could only have one dog.jpg file and if our friend sent us a picture of their dog (dog.jpg) we would have to overwrite our dog.jpg to view their picture. Of course that is ridiculous, but in the world of Java everyone has created HelloWorld.java or a Hello.java at least once. How many programmers do you think put the main method entry point in a class called Main.java?
When it comes to your computer file system, a namespace is a group of related files that all have unique names. For example, c:\program files\java is a namespace where the JDK is installed by default in Windows. The namespace /usr/bin contains binary files for user programs in Linux. In our computer file system, we can also apply security to files and directories. Just like our computer file system, Java provides us with the ability to group our classes into packages. Packages also enable us to secure access to our classes and their members. As a matter of fact, package names must correspond to a directory structure on your computer.
Auf dieser Seite können Sie das Online-Video Learn Java Programming - Introduction to Packages Tutorial mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Daniel Ross 08 August 2015 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 1,665 Mal angesehen und es wurde von 15 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!