I’m not sure what is mean by ‘real life’. But my coding experience tells me that suitable abstract class hierachy might be discount policy e.g. you have concrete classes for new customer discount, customer that has birthday discount, loyal customer discount. And all these discounts are inherited from abstract discount class which might have two methods: is eligible for discount and apply discount
Interviews2 answers
Give a real life example of abstract class?
2 Answers
Bohdan StupakPosted Oct 9, 2021, 9:54 AM EDT
Your Laptop. Probably the best example for abstract class.
The Brand Model can be public classes
The Motherboard, Processors can be private
KeyBoard Can Be Public
Vineeth SreepadPosted Sep 30, 2021, 2:58 PM EDT

