OOP C# Question: Making a Fruit a Pear
- by Adam Kane
Given that I have an instance of Fruit with some properties set, and I want to get those properties into a new Pear instance (because this particular Fruit happens to have the qualities of a pear), what's the best way to achieve this effect?
For example, what we can't do is simple cast a Fruit to a Pear, because not all Fruits are Pears:
public…