Step to create user define Package in Java

Step1:
First Create folder and give name of package to it.
eg: mypack

Step 2:
Set path to folder










Step 3:
Create first class to include in package:
Idk.java

package mypack;
public class Idk
{
public void Hi()
{
System.out.println("Hello JAVA");
}
}

Save as in mypack folder

Step 4:
Write a program to import package 
import mypack.Idk;
class New
{
public static void main(String ar[])
 {
  Idk i=new Idk();
  i.Hi();
 }



Compile And Run the Program:



Output:

Comments