Ask Question
28 July, 19:12

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?

+3
Answers (1)
  1. 28 July, 20:06
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers