Pilot2

Pilot2.cs
01/* Copyright (C) 2007 db4objects Inc. http://www.db4o.com */ 02 03namespace Db4objects.Db4odoc.QBE 04{ 05 class Pilot2 06 { 07 private string _name; 08 private int _points = 100; 09 10 public Pilot2(string name, int points) 11 { 12 _name = name; 13 _points += points; 14 } 15 16 public string Name 17 { 18 get 19 { 20 return _name; 21 } 22 set 23 { 24 _name = value; 25 } 26 } 27 28 public int Points 29 { 30 get 31 { 32 return _points; 33 } 34 } 35 36 public override string ToString() 37 { 38 return string.Format("{0}/{1}", _name, _points); 39 } 40 } 41}
 

Pilot2.vb
01' Copyright (C) 2007 db4objects Inc. http://www.db4o.com 02 03 04Namespace Db4objects.Db4odoc.QBE 05 Class Pilot2 06 Private _name As String 07 Private _points As Integer = 100 08 09 Public Sub New(ByVal name As String, ByVal points As Integer) 10 _name = name 11 _points += points 12 End Sub 13 14 Public Property Name() As String 15 Get 16 Return _name 17 End Get 18 Set(ByVal value As String) 19 _name = value 20 End Set 21 End Property 22 23 Public ReadOnly Property Points() As Integer 24 Get 25 Return _points 26 End Get 27 End Property 28 29 Public Overloads Overrides Function ToString() As String 30 Return String.Format("{0}/{1}", _name, _points) 31 End Function 32 End Class 33End Namespace