Package in Java

package tr2;

public class pack {

private int callme;

public String name;

private void pdis()
System.out.println(“This is private method calling callme ” + callme);
public void pudis()
System.out.println(“This is public method”);

    public static void main(String args[])
pack p2=new pack();



package package1;
import tr2.pack;
public class mainpack extends pack{

     public static void main(String[] args) {

mainpack s1=new mainpack();
//s1.pdis(); //cannot call private methods

Note:TO execute this program we need to make a package in IDE and use this program or if you want to do with command then put the program in 2 different folder with the respective package and execute it.