B is an inner class, with respect to A. It is not subclassing A on the other hand.
More accurately, B is a non-static nested class (which makes it an inner class). A nested class is a member of its enclosing class. Inner classes are allowed to have access to all members of the class that nests them. A private access specifier declared on a member of the enclosing class will not prevent an inner class from accessing the member.
The difference between inheritance via a sub-class and access to members via inner classes is that inheritance of members allows for members to shadowed (for attributes) and overridden (for methods). Inner classes cannot shadow enclosing class attributes, they will have access to them.
To simplify this even further, consider the code sample:
class C
{
void c()
{}
}
public class A {
void a(){}
class B extends C
{
// a new member of B
void b()
{
}
//does not override A.a()
void a()
{
a(); //invokes A.a() as B has access to it.
super.a(); //illegal
}
//overrides C.c()
@Override
void c()
{
super.c(); //invokes C.c()
}
}
}
Notice that you cannot invoke super.a() from the nested class. That's the difference between inheriting a member and merely accessing it.
Further reading