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...

Get Java Garage now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.