I have a class A
private method 1
class B extends A
private method 1 (Same name)
When I instantiate B and method 1 gets called from class A. I made them both protected and that solved it. Is there a way to keep both private and still get class B’s method 1 to be called?
No. Private is designed for that class and that class alone.
Protected is designed for any subclesses to know about, use and override if required.