How to Create a Package in Java


In this example, we will learn the method to create a package in Java.

Source Code

package com.beginner.examples; // package

class CreatePack { 
  public static void main(String[] args) { 
    System.out.println("This is a package!"); 
  }
}

Output:

This is a package!
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments