Write a program in java to demonstrate package?

package one;

import two.*;

public class And

{

      public static void main(String arg[])

      {

            System.out.println("Hello All");

            Pack x=new Pack();

            x.display();

      }

}

 

package two;

public class Pack

{

      public void display()

      {

            System.out.println("Hello Pack");

      }

}

Package.PNG

, , , , ,

Leave a Reply