using System; using System.Collections.Generic; using System.Text; namespace DemoOOP3 { // Parent class // Generalisation: general attributes and code to be shared with child classes class Animal { // Attributes private string _name; private int _age; // In years // Constructors public Animal() // Default constructor { _name = ""; // Default values _age = 0; } public Animal(string name, int age) { _name = name; // Initialise the attribute values _age = age; } // Properties // Methods public string GetName() { return _name; } public void SetName(string name) { _name = name; } public int GetAge() { return _age; } public void SetAge(int age) { _age = age; } public void IncrementAge() { _age++; } } }