Consider the following code
class A{}
class B{
void main(){
A a1=new A();
class A{}
A a2=new A();
System.out.println(a1); // A@___
System.out.println(a2); // B$1A@____
}
}
The class A and class B are not inside any package, How can I create the object of the outer class A inside main() after the method local inner class is created. In other words, how can I create the "a2" object, an object of outer class A?
I checked this by putting these classes in a Package, and I was able to create the object of outer class A using the fully qualified name. But, could not find a way to do the same when they are not inside any package.