Why I cant create a object in extended class which has same name as inner class
<p>I am try to find out why below code is giving error, Can anybody explain please.
Here is a class</p>

<pre><code>package abc;

public class A {
   public class B {

   }
}
</code></pre>

<p>Now I am try to create a B class</p>

<pre><code>package xyz;
import abc.*;


public class B extends A{
    public static void main(String[] args) {
        B b = new B (); // this line gives error. Can you please explain
    }
}
</code></pre>

<p>Please consider class B extends A is in default package means</p>

<pre><code>import abc.*;


public class B extends A{
    public static void main(String[] args) {
        B b = new B (); // this line gives error. Can you please explain 
                          // I am try to create "B" class object which extends A 
                         //.. not the B inner class 
    }
}
</code></pre>

<p>Error shows in eclipse is : "No enclosing instance of type A is accessible. Must qualify the allocation with an enclosing instance of type A (e.g. x.new A() where x is an instance of A)."</p>
