We have class hierarchy similar to this

class A{ public void doSomething(..){}} class B extends A{ public void doOtherThing(..){}}

As per requirement I need only doSomething method to be called. Do I instantiate Class A or B. As per my understanding class A suffices my requirement. Is there any principle/guidance/standard/convention to support my decision?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.