Every Java class is a member of a package. If the class is in the root source directory, it’s said to be in the base package. But, you’ll hardly ever see that happen in production code. Instead, your primary class is frequently in the package that identifies the application.
- [Narrator] I've previously described…how to use custom methods and classes to organize your code.…But there's one more critical tool…that you'll use to organize it even further, packages.…A package is both a description of where a class is…in the application and a location on the file system.…For example, com.example.java means that…there's a subdirectory of the source directory called com,…and a subdirectory of that called example,…and a subdirectory of that java,…and that's the base package for my application.…
In your application, you should use reverse domain notation.…That means you take an organization or personal domain…and you switch it…so if my web domain is davidgassner.com…my package would start with com.davidgassner…and then you would add something after that…to identify the application.…That makes it possible to have class identities…that are universal and unique throughout the world of Java.…Now within a single application,…you can organize your classes with subpackages.…
For example, lets say I wanted to take…
- Debugging Java code
- Handling exceptions
- Creating custom classes
- Working with inheritance
- Managing data collections
- Using Java packages and libraries
- Preparing a Java application for deployment
Skill Level Intermediate
1. Exception Handling and Debugging
2. Create Custom Classes
3. Work with Inheritance
4. Manage Data Collections
5. Use Java Packages and Libraries
Work with dates and times7m 12s
6. Prepare a Java Application for Deployment
Next steps1m 12s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.