//Visual Basic 2008/2010 Inheritance ( Overerving ) - Inherits Object Oriented Programming public class Exercise2Solution { void Main() { Republic france = new Republic(); france.Capital = "Paris"; france.President = "Sarkozy"; Monarchy unitedKingdom = new Monarchy(); unitedKingdom.Capital = "London"; unitedKingdom.Monarch = "Elizabeth"; } } public class Country { private string m_Capital; public virtual string Capital { get { Capital = this.m_Capital; } set { this.m_Capital = value; } } } public class Monarchy : Country { private string m_Monarch; public virtual string Monarch { get { Monarch = this.m_Monarch; } set { this.m_Monarch = value; } } } public class Republic : Country { private string m_President; public virtual string President { get { President = this.m_President; } set { this.m_President = value; } } } //Bezoek www.vbvoorbeelden.be voor meer C# voorbeelden. //Copyright - De Wolf / vbvoorbeelden - 2003-2010 - Alle rechten voorbehouden.