Simple example on Package Java Program

What is Package in Java Program?

– In Simple word, package are folder or directory.

What is use of packages in Java Program?

– When we want to store our classes in proper folder that time we need packages.


I give simple project details with packages storage.

Project: College Management

Student Packages

– Store all Student related classes here

Faculty Packages

– Store all Faculty related classes here

Admin Packages

– Store all admin related classes here

 This structure or customization helps programmer to manage all project.


Example on Packages.

package pack1; //            set path of packages

class example1


public static void main(String args[])


System.out.println(“Welcome in Packages Examples”);



How to compile this program in command prompt

Javac pack1/

How to run this program in command prompt

Java pack1.example1



Welcome in Packages Examples


Video available on YouTube.


If you have any query on blog example, you can directly comment us or subscribe our website

Earn Money Online

1340total visits,2visits today


Hello, I am Maddy a Java blogger, trainer and developer

Related articles

One response to “Simple example on Package Java Program”