O'Reilly logo

Java Garage by Eben Hewitt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Package Declaration

A package is a logical and physical grouping of Java classes and interfaces, whose purpose is to minimize name conflicts. When using the package statement, it must be the first noncomment line in your source file. A package is declared using the package keyword as shown here:

package net.javagarage.utils;
// class definition here...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required