Ask Question
17 June, 05:49

You are c# developer who is developing a windows application. you need to provide derived classes the ability to share common functionality with base classes but still define their own unique behavior. which object-oriented programming concept should you use to accomplish this functionality?

+5
Answers (1)
  1. 17 June, 05:58
    0
    Polymorphism; the concept of one definition, but multiple implementations.

    In C#, this is done using the 'abstract' and 'override' keywords.

    Example:

    abstract class Shape {

    public abstract double area ();

    }

    class Square : Shape {

    private double size;

    public Square (double size = 0) {

    this. size = size;

    }

    public override double area () {

    return size * size;

    }

    }
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “You are c# developer who is developing a windows application. you need to provide derived classes the ability to share common functionality ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers