Lets Consider a package package1
import package1;
public class A //This Class Must Be Public
{
void display()
{
System.out.prinltn("InSide Class A");
}
}
Lets Consider another package package2
import package2;
class B
{
public static void main(String args[])
{
A obj=new A();
obj.display();
}
}
Output:
InSide Class A
import package1;
public class A //This Class Must Be Public
{
void display()
{
System.out.prinltn("InSide Class A");
}
}
Lets Consider another package package2
import package2;
class B
{
public static void main(String args[])
{
A obj=new A();
obj.display();
}
}
Output:
InSide Class A
0 comments:
Post a Comment