Say I have a `ClassA` and `ClassB` extends `ClassA`

```
ClassA {
    private int x;

    private void m1()
    {

    }
}

ClassB extends ClassA {

}

```

Under data encapsulation, we should private the data field and methods. Is that correct?

But, in this case, `ClassB` can not use `ClassA`'s data field and methods.

So, under data encapsulation should I use private access modifiers only?

Can I use protected access modifier rather than private to solve the problem under the rule of data encapsulation?