Ask Question
3 November, 00:00

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. 3 November, 00:22
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers