<?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_Tutorial%2FClass_Module%2FInterface</id>
		<title>VB.Net Tutorial/Class Module/Interface - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.vbex.ru/index.php?action=history&amp;feed=atom&amp;title=VB.Net_Tutorial%2FClass_Module%2FInterface"/>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net_Tutorial/Class_Module/Interface&amp;action=history"/>
		<updated>2026-04-05T05:42:02Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.vbex.ru/index.php?title=VB.Net_Tutorial/Class_Module/Interface&amp;diff=3419&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_Tutorial/Class_Module/Interface&amp;diff=3419&amp;oldid=prev"/>
				<updated>2010-05-26T16:40:30Z</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_Tutorial/Class_Module/Interface&amp;diff=3420&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net_Tutorial/Class_Module/Interface&amp;diff=3420&amp;oldid=prev"/>
				<updated>2010-05-26T12:55:25Z</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;==Implement Interface==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;Option Strict On&lt;br /&gt;
 Imports System&lt;br /&gt;
 Interface Printable&lt;br /&gt;
     Sub Read( )&lt;br /&gt;
     Sub Write(ByVal obj As Object)&lt;br /&gt;
     Property Status( ) As Integer&lt;br /&gt;
 End Interface &lt;br /&gt;
 Public Class Document&lt;br /&gt;
     Implements Printable&lt;br /&gt;
     Public Sub New(ByVal s As String)&lt;br /&gt;
         Console.WriteLine(&amp;quot;Creating document with: {0}&amp;quot;, s)&lt;br /&gt;
     End Sub&lt;br /&gt;
     Public Sub Read( ) Implements Printable.Read&lt;br /&gt;
         Console.WriteLine(&amp;quot;Implementing the Read Method for Printable&amp;quot;)&lt;br /&gt;
     End Sub&lt;br /&gt;
     Public Sub Write(ByVal o As Object) Implements Printable.Write&lt;br /&gt;
         Console.WriteLine(&amp;quot;Implementing the Write Method for Printable&amp;quot;)&lt;br /&gt;
     End Sub&lt;br /&gt;
     Public Property Status( ) As Integer Implements Printable.Status&lt;br /&gt;
         Get&lt;br /&gt;
             Return myStatus&lt;br /&gt;
         End Get&lt;br /&gt;
         Set(ByVal Value As Integer)&lt;br /&gt;
             myStatus = Value&lt;br /&gt;
         End Set&lt;br /&gt;
     End Property&lt;br /&gt;
     Private myStatus As Integer = 0&lt;br /&gt;
 End Class&lt;br /&gt;
 Class Tester&lt;br /&gt;
     Public Shared Sub Main( )&lt;br /&gt;
         Dim doc As New Document(&amp;quot;Test Document&amp;quot;)&lt;br /&gt;
         doc.Status = -1&lt;br /&gt;
         doc.Read( )&lt;br /&gt;
         Console.WriteLine(&amp;quot;Document Status: {0}&amp;quot;, doc.Status)&lt;br /&gt;
     End Sub &lt;br /&gt;
 End Class&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;Creating document with: Test Document&lt;br /&gt;
Implementing the Read Method for Printable&lt;br /&gt;
Document Status: -1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Inheritance And Interfaces==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;Imports System&lt;br /&gt;
Imports System.Collections&lt;br /&gt;
Public Interface Printable&lt;br /&gt;
  ReadOnly Property Print() As Integer&lt;br /&gt;
End Interface&lt;br /&gt;
Public Class Money&lt;br /&gt;
  Implements Printable&lt;br /&gt;
  Protected mTransactions As New ArrayList()&lt;br /&gt;
  ReadOnly Property Print() As Integer Implements Printable.Print&lt;br /&gt;
    Get&lt;br /&gt;
      Return mTransactions.Count&lt;br /&gt;
    End Get&lt;br /&gt;
  End Property&lt;br /&gt;
  Public Overridable ReadOnly Property Balance() As Double&lt;br /&gt;
    Get&lt;br /&gt;
      Dim result As Double = 0.0&lt;br /&gt;
      Dim i As Integer&lt;br /&gt;
      For i = 0 To mTransactions.Count - 1&lt;br /&gt;
        result += CDbl(mTransactions(i))&lt;br /&gt;
      Next&lt;br /&gt;
      Return result&lt;br /&gt;
    End Get&lt;br /&gt;
  End Property&lt;br /&gt;
  Public Sub Add(ByVal amount As Double)&lt;br /&gt;
    mTransactions.Add(amount)&lt;br /&gt;
  End Sub&lt;br /&gt;
  Public Sub Subtract(ByVal amount As Double)&lt;br /&gt;
    mTransactions.Add(-amount)&lt;br /&gt;
  End Sub&lt;br /&gt;
End Class&lt;br /&gt;
Public Class MyMoney&lt;br /&gt;
  Inherits Money&lt;br /&gt;
  Public Overrides ReadOnly Property Balance() As Double&lt;br /&gt;
    Get&lt;br /&gt;
      Return MyBase.Balance - Print * 2&lt;br /&gt;
    End Get&lt;br /&gt;
  End Property&lt;br /&gt;
End Class&lt;br /&gt;
Module Test&lt;br /&gt;
  Sub Main()&lt;br /&gt;
    Dim acc1 As New Money()&lt;br /&gt;
    acc1.Add(200)&lt;br /&gt;
    acc1.Subtract(40)&lt;br /&gt;
    acc1.Add(30)&lt;br /&gt;
    Console.Write(&amp;quot;count: {0}, &amp;quot;, acc1.Print)&lt;br /&gt;
    Console.WriteLine(&amp;quot;balance: {0}&amp;quot;, acc1.Balance)&lt;br /&gt;
    Dim acc2 As New MyMoney()&lt;br /&gt;
    acc2.Add(200)&lt;br /&gt;
    acc2.Subtract(40)&lt;br /&gt;
    acc2.Add(30)&lt;br /&gt;
    Console.Write(&amp;quot;count: {0}, &amp;quot;, acc2.Print)&lt;br /&gt;
    Console.WriteLine(&amp;quot;balance: {0}&amp;quot;, acc2.Balance)&lt;br /&gt;
  End Sub&lt;br /&gt;
End Module&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;count: 3, balance: 190&lt;br /&gt;
count: 3, balance: 184&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Interface Inherits Interface==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;Imports System&lt;br /&gt;
 Interface Printable&lt;br /&gt;
     Sub Read( )&lt;br /&gt;
     Sub Write(ByVal obj As Object)&lt;br /&gt;
     Property Status( ) As Integer&lt;br /&gt;
 End Interface &amp;quot;Printable&lt;br /&gt;
 Interface Zippable&lt;br /&gt;
     Sub Zip( )&lt;br /&gt;
     Sub Unzip( )&lt;br /&gt;
 End Interface &amp;quot;Zippable&lt;br /&gt;
 Interface Zippable2 &lt;br /&gt;
 Inherits Zippable&lt;br /&gt;
     Sub Email( )&lt;br /&gt;
 End Interface &lt;br /&gt;
 Public Class Document &lt;br /&gt;
 Implements Zippable2, Printable&lt;br /&gt;
   Public Sub New(s As String)&lt;br /&gt;
     Console.WriteLine(&amp;quot;Creating document with: {0}&amp;quot;, s)&lt;br /&gt;
 End Sub&lt;br /&gt;
     Public Sub Read( ) Implements Printable.Read&lt;br /&gt;
     Console.WriteLine(&amp;quot;Implementing the Read Method for Printable&amp;quot;)&lt;br /&gt;
     End Sub &amp;quot;Read&lt;br /&gt;
     Public Sub Write(ByVal o As Object) Implements Printable.Write&lt;br /&gt;
         Console.WriteLine( _&lt;br /&gt;
               &amp;quot;Implementing the Write Method for Printable&amp;quot;)&lt;br /&gt;
     End Sub &amp;quot;Write&lt;br /&gt;
     Public Property Status( ) As Integer Implements Printable.Status&lt;br /&gt;
         Get&lt;br /&gt;
             Return myStatus&lt;br /&gt;
         End Get&lt;br /&gt;
         Set(ByVal Value As Integer)&lt;br /&gt;
             myStatus = Value&lt;br /&gt;
         End Set&lt;br /&gt;
     End Property&lt;br /&gt;
     Public Sub Zip( ) Implements Zippable.Zip&lt;br /&gt;
         Console.WriteLine(&amp;quot;Implementing Zip&amp;quot;)&lt;br /&gt;
     End Sub&lt;br /&gt;
     Public Sub Unzip( ) Implements Zippable.Unzip&lt;br /&gt;
         Console.WriteLine(&amp;quot;Implementing Unzip&amp;quot;)&lt;br /&gt;
     End Sub&lt;br /&gt;
     Public Sub Email( ) Implements Zippable2.Email&lt;br /&gt;
         Console.WriteLine(&amp;quot;Implementing Email&amp;quot;)&lt;br /&gt;
     End Sub &lt;br /&gt;
     Private myStatus As Integer = 0&lt;br /&gt;
 End Class &amp;quot;Document&lt;br /&gt;
 Class Tester&lt;br /&gt;
     Shared Sub Main( )&lt;br /&gt;
         Dim doc As New Document(&amp;quot;Test Document&amp;quot;)&lt;br /&gt;
         If TypeOf doc Is Printable Then&lt;br /&gt;
             Dim isDoc As Printable = doc&lt;br /&gt;
             isDoc.Read( )&lt;br /&gt;
         Else&lt;br /&gt;
             Console.WriteLine(&amp;quot;Could not cast to Printable&amp;quot;)&lt;br /&gt;
         End If&lt;br /&gt;
         If TypeOf doc Is Zippable2 Then&lt;br /&gt;
             Dim ilDoc As Zippable2 = doc&lt;br /&gt;
             Console.Write(&amp;quot;Calling both Zippable and &amp;quot;)&lt;br /&gt;
             Console.WriteLine(&amp;quot;Zippable2 methods...&amp;quot;)&lt;br /&gt;
             ilDoc.Zip( )&lt;br /&gt;
             ilDoc.Email( )&lt;br /&gt;
         Else&lt;br /&gt;
             Console.WriteLine(&amp;quot;Could not cast to Zippable2&amp;quot;)&lt;br /&gt;
         End If&lt;br /&gt;
         If TypeOf doc Is Zippable Then&lt;br /&gt;
             Dim icDoc As Zippable = doc &amp;quot;&lt;br /&gt;
             Console.WriteLine( _&lt;br /&gt;
                &amp;quot;Treating the object as Zipible... &amp;quot;)&lt;br /&gt;
             icDoc.Zip( )&lt;br /&gt;
         Else&lt;br /&gt;
             Console.WriteLine(&amp;quot;Could not cast to Zippable&amp;quot;)&lt;br /&gt;
         End If&lt;br /&gt;
     End Sub&lt;br /&gt;
 End Class&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;Creating document with: Test Document&lt;br /&gt;
Implementing the Read Method for Printable&lt;br /&gt;
Calling both Zippable and Zippable2 methods...&lt;br /&gt;
Implementing Zip&lt;br /&gt;
Implementing Email&lt;br /&gt;
Treating the object as Zipible...&lt;br /&gt;
Implementing Zip&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Interface with Property==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;Class Tester&lt;br /&gt;
   Shared Sub Main()&lt;br /&gt;
      Dim tree As New Plant(1976)&lt;br /&gt;
      Dim person As New Animal(&amp;quot;B&amp;quot;, &amp;quot;J&amp;quot;, 1983)&lt;br /&gt;
      Dim iAgeArray As Markable() = New Markable(1) {}&lt;br /&gt;
      iAgeArray(0) = tree&lt;br /&gt;
      iAgeArray(1) = person&lt;br /&gt;
      Console.WriteLine(tree.ToString() &amp;amp; &amp;quot;: &amp;quot; &amp;amp; _&lt;br /&gt;
         tree.Name &amp;amp; vbCrLf &amp;amp; &amp;quot;Age is &amp;quot; &amp;amp; tree.Age)&lt;br /&gt;
      Console.WriteLine(person.ToString() &amp;amp; &amp;quot;: &amp;quot; &amp;amp; _&lt;br /&gt;
         person.Name &amp;amp; vbCrLf &amp;amp; &amp;quot;Age is &amp;quot; &amp;amp; person.Age)&lt;br /&gt;
      Dim ageReference As Markable&lt;br /&gt;
      For Each ageReference In iAgeArray&lt;br /&gt;
         Console.WriteLine(ageReference.Name &amp;amp; &amp;quot;: &amp;quot; &amp;amp; _&lt;br /&gt;
            &amp;quot;Age is &amp;quot; &amp;amp; ageReference.Age)&lt;br /&gt;
      Next&lt;br /&gt;
   End Sub &amp;quot; Main&lt;br /&gt;
End Class&lt;br /&gt;
&lt;br /&gt;
Public Interface Markable&lt;br /&gt;
   ReadOnly Property Age() As Integer&lt;br /&gt;
   ReadOnly Property Name() As String&lt;br /&gt;
End Interface&lt;br /&gt;
Public Class Animal&lt;br /&gt;
   Implements Markable&lt;br /&gt;
   Private mYearBorn As Integer&lt;br /&gt;
   Private mFirstName As String&lt;br /&gt;
   Private mLastName As String&lt;br /&gt;
   Public Sub New(ByVal firstNameValue As String, _&lt;br /&gt;
      ByVal lastNameValue As String, _&lt;br /&gt;
      ByVal yearBornValue As Integer)&lt;br /&gt;
      mFirstName = firstNameValue&lt;br /&gt;
      mLastName = lastNameValue&lt;br /&gt;
      mYearBorn = yearBornValue&lt;br /&gt;
   End Sub &amp;quot; New&lt;br /&gt;
   ReadOnly Property Age() As Integer _&lt;br /&gt;
      Implements Markable.Age&lt;br /&gt;
      Get&lt;br /&gt;
         Return Date.Now.Year - mYearBorn&lt;br /&gt;
      End Get&lt;br /&gt;
   End Property &amp;quot; Age&lt;br /&gt;
   ReadOnly Property Name() As String _&lt;br /&gt;
      Implements Markable.Name&lt;br /&gt;
      Get&lt;br /&gt;
         Return mFirstName &amp;amp; &amp;quot; &amp;quot; &amp;amp; mLastName&lt;br /&gt;
      End Get&lt;br /&gt;
   End Property &amp;quot; Name&lt;br /&gt;
End Class&lt;br /&gt;
Public Class Plant&lt;br /&gt;
   Implements Markable&lt;br /&gt;
   Private mRings As Integer&lt;br /&gt;
   Public Sub New(ByVal yearPlanted As Integer)&lt;br /&gt;
      mRings = Date.Now.Year - yearPlanted&lt;br /&gt;
   End Sub &amp;quot; New&lt;br /&gt;
   Public Sub AddRing()&lt;br /&gt;
      mRings += 1&lt;br /&gt;
   End Sub &amp;quot; AddRing&lt;br /&gt;
   ReadOnly Property Age() As Integer _&lt;br /&gt;
      Implements Markable.Age&lt;br /&gt;
      Get&lt;br /&gt;
         Return mRings&lt;br /&gt;
      End Get&lt;br /&gt;
   End Property &amp;quot; Age&lt;br /&gt;
   ReadOnly Property Name() As String _&lt;br /&gt;
      Implements Markable.Name&lt;br /&gt;
      Get&lt;br /&gt;
         Return &amp;quot;Tree&amp;quot;&lt;br /&gt;
      End Get&lt;br /&gt;
   End Property &amp;quot; Name&lt;br /&gt;
End Class&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;Plant: Tree&lt;br /&gt;
Age is 31&lt;br /&gt;
Animal: B J&lt;br /&gt;
Age is 24&lt;br /&gt;
Tree: Age is 31&lt;br /&gt;
B J: Age is 24&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Interface with two methods==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;Interface Speak&lt;br /&gt;
    Sub GoodMorning()&lt;br /&gt;
    Sub GoodEvening(ByVal CurrentDate As DateTime)&lt;br /&gt;
End Interface&lt;br /&gt;
Class English&lt;br /&gt;
    Implements Speak&lt;br /&gt;
    Public Sub GoodMorning() Implements Speak.GoodMorning&lt;br /&gt;
        Console.WriteLine(&amp;quot;Good morning!&amp;quot;)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Public Sub GoodEvening(ByVal CurrentDate As DateTime) Implements Speak.GoodEvening&lt;br /&gt;
        Console.WriteLine(&amp;quot;Good evening -- it is now &amp;quot; &amp;amp; CurrentDate)&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
Class Spanish&lt;br /&gt;
    Implements Speak&lt;br /&gt;
    Public Sub GoodMorning() Implements Speak.GoodMorning&lt;br /&gt;
        Console.WriteLine(&amp;quot;Buenos Dias!&amp;quot;)&lt;br /&gt;
        Console.WriteLine(Now())&lt;br /&gt;
    End Sub&lt;br /&gt;
    Public Sub GoodEvening(ByVal CurrentDate As DateTime) Implements Speak.GoodEvening&lt;br /&gt;
        Console.WriteLine(&amp;quot;Buenas noches -- La fetcha y hora son &amp;quot; &amp;amp; CurrentDate)&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
&lt;br /&gt;
Module Module1&lt;br /&gt;
    Sub Main()&lt;br /&gt;
        Dim Hello As New English()&lt;br /&gt;
        Dim Hola As New Spanish()&lt;br /&gt;
        Hello.GoodMorning()&lt;br /&gt;
        Hello.GoodEvening(Now())&lt;br /&gt;
        Hola.GoodMorning()&lt;br /&gt;
        Hola.GoodEvening(Now())&lt;br /&gt;
    End Sub&lt;br /&gt;
End Module&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;Good morning!&lt;br /&gt;
Good evening -- it is now 11/05/2007 9:29:46 PM&lt;br /&gt;
Buenos Dias!&lt;br /&gt;
11/05/2007 9:29:46 PM&lt;br /&gt;
Buenas noches -- La fetcha y hora son 11/05/2007 9:29:46 PM&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==One Class implements two interfaces==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;Option Strict On&lt;br /&gt;
 Imports System&lt;br /&gt;
     Interface Printable&lt;br /&gt;
         Sub Read( )&lt;br /&gt;
         Sub Write(ByVal obj As Object)&lt;br /&gt;
         Property Status( ) As Integer&lt;br /&gt;
     End Interface &amp;quot;Printable&lt;br /&gt;
     Interface Zippable&lt;br /&gt;
         Sub Zip( )&lt;br /&gt;
         Sub Unzip( )&lt;br /&gt;
     End Interface&lt;br /&gt;
     Public Class Document&lt;br /&gt;
         Implements Zippable, Printable&lt;br /&gt;
         Public Sub New(ByVal s As String)&lt;br /&gt;
             Console.WriteLine(&amp;quot;Creating document with: {0}&amp;quot;, s)&lt;br /&gt;
         End Sub &amp;quot;New&lt;br /&gt;
         Public Sub Read( ) Implements Printable.Read&lt;br /&gt;
             Console.WriteLine(&amp;quot;Implementing the Read Method for Printable&amp;quot;)&lt;br /&gt;
         End Sub &amp;quot;Read&lt;br /&gt;
         Public Sub Write(ByVal o As Object) Implements Printable.Write&lt;br /&gt;
             Console.WriteLine( _&lt;br /&gt;
               &amp;quot;Implementing the Write Method for Printable&amp;quot;)&lt;br /&gt;
         End Sub &amp;quot;Write&lt;br /&gt;
    Public Property Status( ) As Integer Implements Printable.Status&lt;br /&gt;
             Get&lt;br /&gt;
                 Return myStatus&lt;br /&gt;
             End Get&lt;br /&gt;
             Set(ByVal Value As Integer)&lt;br /&gt;
                 myStatus = Value&lt;br /&gt;
             End Set&lt;br /&gt;
         End Property&lt;br /&gt;
         Public Sub Zip( ) Implements Zippable.Zip&lt;br /&gt;
             Console.WriteLine(&amp;quot;Implementing Zip&amp;quot;)&lt;br /&gt;
         End Sub&lt;br /&gt;
         Public Sub Unzip( ) Implements Zippable.Unzip&lt;br /&gt;
             Console.WriteLine(&amp;quot;Implementing Unzip&amp;quot;)&lt;br /&gt;
         End Sub&lt;br /&gt;
         Private myStatus As Integer = 0&lt;br /&gt;
     End Class &lt;br /&gt;
     Class Tester&lt;br /&gt;
         Shared Sub Main( )&lt;br /&gt;
             Dim doc As New Document(&amp;quot;Test Document&amp;quot;)&lt;br /&gt;
             doc.Status = -1&lt;br /&gt;
             doc.Read( )&lt;br /&gt;
             doc.Zip( )&lt;br /&gt;
             Console.WriteLine(&amp;quot;Document Status: {0}&amp;quot;, doc.Status)&lt;br /&gt;
         End Sub &amp;quot;Main&lt;br /&gt;
     End Class&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;Creating document with: Test Document&lt;br /&gt;
Implementing the Read Method for Printable&lt;br /&gt;
Implementing Zip&lt;br /&gt;
Document Status: -1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Public Sub aMethod() Implements Interface1.Method, Interface2.Method==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;Public Interface I1&lt;br /&gt;
    Sub Draw()&lt;br /&gt;
End Interface&lt;br /&gt;
Public Interface I2&lt;br /&gt;
    Sub Draw()&lt;br /&gt;
End Interface&lt;br /&gt;
Public Class Class1&lt;br /&gt;
    Implements I1, I2&lt;br /&gt;
    Public Sub foo() Implements I1.Draw, I2.Draw&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Reimplement interface==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;Class BaseClass&lt;br /&gt;
    Implements IFormattable&lt;br /&gt;
    Implements IComparable&lt;br /&gt;
    Public Value As String&lt;br /&gt;
    Public Overridable Overloads Function ToString(ByVal _&lt;br /&gt;
      Format As String, ByVal Provider As IFormatProvider) _&lt;br /&gt;
      As String Implements IFormattable.ToString&lt;br /&gt;
        ToString = Value&lt;br /&gt;
    End Function&lt;br /&gt;
    Public Overridable Overloads Function CompareTo(ByVal A _&lt;br /&gt;
      As Object) As Integer Implements IComparable.rupareTo&lt;br /&gt;
        If (Value = A.Value) Then&lt;br /&gt;
            CompareTo = 0&lt;br /&gt;
        ElseIf (Value &amp;lt; A.Value) Then&lt;br /&gt;
            CompareTo = -1&lt;br /&gt;
        Else&lt;br /&gt;
            CompareTo = 1&lt;br /&gt;
        End If&lt;br /&gt;
    End Function&lt;br /&gt;
    Public Sub New(ByVal Value As String)&lt;br /&gt;
        Me.Value = Value&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
Class DerivedClass&lt;br /&gt;
    Inherits BaseClass&lt;br /&gt;
    Public Overrides Function ToString(ByVal _&lt;br /&gt;
      Format As String, ByVal Provider As IFormatProvider) _&lt;br /&gt;
      As String&lt;br /&gt;
        ToString = UCase(Value)&lt;br /&gt;
    End Function&lt;br /&gt;
    Public Sub New(ByVal Value As String)&lt;br /&gt;
        MyBase.New(Value)&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
Module Module1&lt;br /&gt;
    Sub Main()&lt;br /&gt;
        Dim A As New BaseClass(&amp;quot;Hello&amp;quot;)&lt;br /&gt;
        Dim B As New DerivedClass(&amp;quot;Hi&amp;quot;)&lt;br /&gt;
        Console.WriteLine(A)&lt;br /&gt;
        Console.WriteLine(B)&lt;br /&gt;
        Console.WriteLine(A.rupareTo(B))&lt;br /&gt;
    End Sub&lt;br /&gt;
End Module&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;Hello&lt;br /&gt;
HI&lt;br /&gt;
-1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Two classes implement one interface==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;public class Test&lt;br /&gt;
   public Shared Sub Main&lt;br /&gt;
        Dim rect As New Rectangle()&lt;br /&gt;
        Dim trap As New Trapezoid()&lt;br /&gt;
        rect.Draw()&lt;br /&gt;
        trap.Draw()&lt;br /&gt;
   End Sub&lt;br /&gt;
End class&lt;br /&gt;
Public Interface IShape&lt;br /&gt;
    Function Draw() As String&lt;br /&gt;
End Interface&lt;br /&gt;
Public Class Rectangle&lt;br /&gt;
    Implements IShape&lt;br /&gt;
    Public Function Draw() As String Implements IShape.Draw&lt;br /&gt;
        Return &amp;quot;Drawing Rectangle&amp;quot;&lt;br /&gt;
    End Function&lt;br /&gt;
End Class&lt;br /&gt;
Public Class Trapezoid&lt;br /&gt;
    Implements IShape&lt;br /&gt;
    Public Function Draw() As String Implements IShape.Draw&lt;br /&gt;
        Return &amp;quot;Drawing Trapezoid&amp;quot;&lt;br /&gt;
    End Function&lt;br /&gt;
End Class&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>