Interviews3 answers
Suppose you have 3 classes - ClassA , ClassB , ClassC ClassA will have 3 method MethodA() , MethodB(), MethodC().You are inheriting this ClassA in ClassB and ClassC.You want to MethodB Should not be accessible in ClassC , and MethodC Should not be accessible in ClassA. how you will design classes and inheritance ? is that possible in OOP's ??
3 Answers
Yes. In class B define method B as sealed.
hitesh baseraPosted Nov 28, 2020, 12:05 AM EST
I don;t think this possible.Post the answe if it is possible.
prashath reddyPosted Sep 26, 2019, 4:18 AM EDT
This is not possible.
Sudarshan HajarePosted May 16, 2019, 12:43 AM EDT

