I have this simple code :
public class A
{
int _private=3;
public A (B b)
{
b._private=5;
}
}
public class B:A
{
}
this code compiles
Via
OOP
- theb
should not provide access to_private
.Via private and
A
,A
knows_private
, but still the access is made throughb
!
what is going on here ?