package MyMath;
public class MyPack
public int method_1()
//System.out.println("Hello World");
int n1 = 10 + 10;
String str = "Hello Wrold Good day";
System.out.println("Hello World");
return n1;

saved in

Testing MyMath Package and using MyPack class in the folder name MyMath.

import MyMath.*;
//importing the package not the class
//now create a class that will use this package
public class Math_Test
public static void main(String args[])
MyPack m = new MyPack();


//end of the class

Generates a BAT file tp2base.BAT

shows all the output