<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://www.vbex.ru/index.php?action=history&amp;feed=atom&amp;title=VB.Net%2FClass%2FToString</id>
		<title>VB.Net/Class/ToString - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.vbex.ru/index.php?action=history&amp;feed=atom&amp;title=VB.Net%2FClass%2FToString"/>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net/Class/ToString&amp;action=history"/>
		<updated>2026-04-05T05:57:41Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.vbex.ru/index.php?title=VB.Net/Class/ToString&amp;diff=378&amp;oldid=prev</id>
		<title> в 16:40, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net/Class/ToString&amp;diff=378&amp;oldid=prev"/>
				<updated>2010-05-26T16:40:06Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 16:40, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://www.vbex.ru/index.php?title=VB.Net/Class/ToString&amp;diff=379&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net/Class/ToString&amp;diff=379&amp;oldid=prev"/>
				<updated>2010-05-26T12:42:47Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Override Object.ToString==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;&lt;br /&gt;
Imports System&lt;br /&gt;
Public Class MainClass&lt;br /&gt;
    &lt;br /&gt;
    Shared Sub Main()&lt;br /&gt;
         Dim i As Integer = 5&lt;br /&gt;
         Console.WriteLine(&amp;quot;The value of i is: {0}&amp;quot;, i.ToString(  ))&lt;br /&gt;
         Dim milo As New Dog(62)&lt;br /&gt;
         Console.WriteLine(&amp;quot;My dog Milo weighs {0} pounds&amp;quot;, milo.ToString(  ))&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
&lt;br /&gt;
 Public Class Dog&lt;br /&gt;
     Private weight As Integer&lt;br /&gt;
     Public Sub New(ByVal weight As Integer)&lt;br /&gt;
         Me.weight = weight&lt;br /&gt;
     End Sub &amp;quot;New&lt;br /&gt;
     Public Overrides Function ToString(  ) As String&lt;br /&gt;
         Return weight.ToString(  )&lt;br /&gt;
     End Function &amp;quot;ToString&lt;br /&gt;
 End Class &amp;quot;Dog&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Override ToString function==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;&lt;br /&gt;
Imports System&lt;br /&gt;
Public Class MainClass&lt;br /&gt;
    Shared Sub Main(ByVal args As String())&lt;br /&gt;
      Dim point As Point&lt;br /&gt;
      point = New Point(72, 115) &amp;quot; instantiate Point object&lt;br /&gt;
      &amp;quot; display point coordinates via X and Y properties&lt;br /&gt;
      Console.WriteLine( &amp;quot;X coordinate is &amp;quot; &amp;amp; point.X &amp;amp; _&lt;br /&gt;
         vbCrLf &amp;amp; &amp;quot;Y coordinate is &amp;quot; &amp;amp; point.Y )&lt;br /&gt;
      point.X = 10 &amp;quot; set x-coordinate via X property&lt;br /&gt;
      point.Y = 10 &amp;quot; set y-coordinate via Y property&lt;br /&gt;
      &amp;quot; display new point value&lt;br /&gt;
      Console.WriteLine(&amp;quot;The new location of point is &amp;quot; &amp;amp; point.ToString() )&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
&amp;quot; Point class represents an x-y coordinate pair.&lt;br /&gt;
Public Class Point&lt;br /&gt;
   &amp;quot; implicitly Inherits Object&lt;br /&gt;
   Private mX, mY As Integer&lt;br /&gt;
   Public Sub New()&lt;br /&gt;
      &amp;quot; implicit call to Object constructor occurs here&lt;br /&gt;
      X = 0&lt;br /&gt;
      Y = 0&lt;br /&gt;
   End Sub &amp;quot; New&lt;br /&gt;
   &amp;quot; constructor&lt;br /&gt;
   Public Sub New(ByVal xValue As Integer,ByVal yValue As Integer)&lt;br /&gt;
      &amp;quot; implicit call to Object constructor occurs here&lt;br /&gt;
      X = xValue&lt;br /&gt;
      Y = yValue&lt;br /&gt;
   End Sub &amp;quot; New&lt;br /&gt;
   &amp;quot; property X&lt;br /&gt;
   Public Property X() As Integer&lt;br /&gt;
      Get&lt;br /&gt;
         Return mX&lt;br /&gt;
      End Get&lt;br /&gt;
      Set(ByVal xValue As Integer)&lt;br /&gt;
         mX = xValue &amp;quot; no need for validation&lt;br /&gt;
      End Set&lt;br /&gt;
   End Property &amp;quot; X&lt;br /&gt;
   &amp;quot; property Y &lt;br /&gt;
   Public Property Y() As Integer&lt;br /&gt;
      Get&lt;br /&gt;
         Return mY&lt;br /&gt;
      End Get&lt;br /&gt;
      Set(ByVal yValue As Integer)&lt;br /&gt;
         mY = yValue &amp;quot; no need for validation&lt;br /&gt;
      End Set&lt;br /&gt;
   End Property &amp;quot; Y&lt;br /&gt;
   &amp;quot; return String representation of Point&lt;br /&gt;
   Public Overrides Function ToString() As String&lt;br /&gt;
      Return &amp;quot;[&amp;quot; &amp;amp; mX &amp;amp; &amp;quot;, &amp;quot; &amp;amp; mY &amp;amp; &amp;quot;]&amp;quot;&lt;br /&gt;
   End Function &amp;quot; ToString&lt;br /&gt;
End Class &lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Override ToString Method to provide meaningful information==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;&lt;br /&gt;
Imports System&lt;br /&gt;
Imports System.IO&lt;br /&gt;
&lt;br /&gt;
Public Class MainClass&lt;br /&gt;
  Shared Sub Main()&lt;br /&gt;
        Dim e As New Employee(&amp;quot;Joe&amp;quot;, 10000)&lt;br /&gt;
        Console.WriteLine(e.TheName &amp;amp; &amp;quot; salary is &amp;quot; &amp;amp; e.Salary)&lt;br /&gt;
       &lt;br /&gt;
        Console.WriteLine(e)&lt;br /&gt;
  End Sub&lt;br /&gt;
  Public Class Employee&lt;br /&gt;
    Private m_Name As String&lt;br /&gt;
    Private m_Salary As Decimal&lt;br /&gt;
    Public Sub New(ByVal sName As String, ByVal curSalary As Decimal)&lt;br /&gt;
            If sName = String.Empty Then&lt;br /&gt;
                Console.WriteLine(&amp;quot;no names&amp;quot;)&lt;br /&gt;
            Else&lt;br /&gt;
                m_Name = sName&lt;br /&gt;
            End If&lt;br /&gt;
    End Sub&lt;br /&gt;
        Public Property TheName() As String&lt;br /&gt;
            Get&lt;br /&gt;
                Return m_Name&lt;br /&gt;
            End Get&lt;br /&gt;
            Set(ByVal Value As String)&lt;br /&gt;
                m_Name = Value&lt;br /&gt;
            End Set&lt;br /&gt;
        End Property&lt;br /&gt;
        Public ReadOnly Property Salary() As Decimal&lt;br /&gt;
            Get&lt;br /&gt;
                Return m_Salary&lt;br /&gt;
            End Get&lt;br /&gt;
        End Property&lt;br /&gt;
       &lt;br /&gt;
        Public Overrides Function ToString() As String&lt;br /&gt;
            Return (m_Name &amp;amp; &amp;quot; &amp;quot; &amp;amp; Me.GetType.ToString)&lt;br /&gt;
        End Function&lt;br /&gt;
    End Class&lt;br /&gt;
End Class&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>