//Visual Basic 2008/2010 Containment Object Oriented Programming public class Position { private int m_X; private int m_Y; public virtual int X { get { X = this.m_X; } set { this.m_X = value; } } public virtual int Y { get { Y = this.m_Y; } set { this.m_Y = value; } } } public class PositionTextFixture { void Main() { Position position1 = new Position(); Console.WriteLine((position1.X == 0)); Console.WriteLine((position1.Y == 0)); position1.X = 5; Console.WriteLine((position1.X == 5)); Console.WriteLine((position1.Y == 0)); position1.Y = 10; Console.WriteLine((position1.X == 5)); Console.WriteLine((position1.Y == 10)); Console.ReadLine(); } } //Bezoek www.vbvoorbeelden.be voor meer C# voorbeelden. //Copyright - De Wolf / vbvoorbeelden - 2003-2010 - Alle rechten voorbehouden.