...

/

Virtual Methods and Properties

Virtual Methods and Properties

Learn to override methods and properties.

Override methods

When we inherit a method from a base class, we might need to change its behavior in a child class. Consider the following example:

public class Animal
{
	public void Voice()
	{
		// Method implementation
	}
}

Let’s imagine that the Voice() method produces the voice of an animal. For something as generic as the Animal ...

Access this course and 1400+ top-rated courses and projects.