From the course: Java 8 Essential Training
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Organizing Java classes in packages - Java Tutorial
From the course: Java 8 Essential Training
Organizing Java classes in packages
- Java developers typically organize their classes in packages. A package is a unique identifier that goes at the top of the class declaration. But it actually matches a folder hierarchy. As you've seen, you can create your Java classes in a project root folder, also known as the base package, but to keep your classes well organized, you should start with packages from the very beginning. I'm going to open this version of my Main class which is in the Packages folder. Packages is my project root and once again, I'll use a simple text editor. And I'm going to add a string at the top of the class declaration starting with the keyword package. Now, you can use any string you like as a package identifier but typically, they're formed from domains using reverse domain notation. So, if your domain is example.com, your package would start with com.example. and that would match your organization or company's domain but then you might add another string under that to make this unique to the…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Hello World5m 44s
-
(Locked)
Passing arguments to a console application2m 53s
-
(Locked)
Organizing Java classes in packages4m 12s
-
Creating a Java project in IntelliJ IDEA7m 28s
-
(Locked)
Taking a tour of IntelliJ IDEA3m 35s
-
(Locked)
Creating a Java project in BlueJ4m 43s
-
(Locked)
Using the Java API documentation3m 44s
-
(Locked)
-
-
-
-
-
-
-
-
-
-