Reply
Tue 30 Jun, 2009 01:58 pm
class a
{
public void aFn()
{
System.out.println("Im in A");
}
}
class b
{
public void bFn()
{
System.out.println("I'm in B");
}
public static void main(String args[])
{
class a= new a();
a.aFn();
class b= new b();
b.bFn();
}
}
the name of the file saved is b.java
The output is
Im in A
Im in B
My question is that how can we access other class as the default access specifier is package. we haven't imported the package.
Please clear me through the concept of accessing a class .