Md Sarfaraj
Give a real life example of abstract class?

Give a real life example of abstract class?

By Md Sarfaraj in .NET on Sep 15 2021
  • Bohdan Stupak
    Oct, 2021 9

    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

    • 2
  • Vineeth Sreepad
    Sep, 2021 30

    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

    • 0

Most Popular Job Functions