For example :
indicates that Math is a class in lang package and that lang is a package in java package. To use Math class one must write the import statement. The following package hirarchy a is wrong because com can’t be a root folder. where as book.com.prenhall is a correct hirarchy.
Example 1 : Student Class in student package
package student; //Package name is student.
//Student class is defined inside the student package.
private int ID;
private String name;