I'm learning inheritance in java. While writing small code where I'm learning we cannot access private members of superclass in subclass.
Here is my code:
class A {
    int i;
    private int j;
    void setij(int x, int y) {
        i = x;
        j = y;
    }
    class B extends A {
        int b;
        void sum() {
            b = i + j;
        }
    }
When I create a new class in eclipse, am not able to create an object of sublcass B in class A.
class mainclass{
            public static void main(String args[]){
                 B object = new B(); ----error
            }
        }
    }
Error says class B needs to be created.
May I know why is happening ..? Its happening not a problem but I want to solve and understand the logic why it was happened.
Thanks
 
     
    