// Java program to illustrate
protected modifier
package two;
import one.*; // importing all classes in package one
// Class B is subclass of A
class B extends A
{
public static void main(String args[])
{
B obj = new B();
obj.display();
}
}
// Java program to illustrate
public modifier
package one;
public class A
{
public void display()
{
System.out.println("Welcome to softhunt.net");
}
}
package two;
import one.*;
class B {
public static void main(String args[])
{
A obj = new A();
obj.display();
}
}