From the course: Java 11+ Essential Training

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Organize code with packages

Organize code with packages - Java Tutorial

From the course: Java 11+ Essential Training

Start my 1-month free trial

Organize code with packages

- [Instructor] Java uses the concept of packages to organize code. A package matches a directory structure. In this application, I have two classes that are in a package named com.company. As I've shown previously, you can configure IntelliJ IDEA to compact or not compact middle packages. When you don't compact them, you see these as a directory structure. And in fact, that's how these files are stored on disk. I'll right-click on the source directory and choose Reveal in Finder on Mac or Reveal in Explorer on Windows. And show that there's a sub-directory of the source directory named "com," which has a sub-directory of company and that's where the files are. When you compile your files, they're stored in a similar directory structure under the project root. I'll reveal this in Finder and show that once again I have a com directory and a company sub-directory and here are my compiled class files. You can…

Contents