-Imports System\r
-\r
-'Testing simple and multi-level inheritence with all methods declared public\r
-\r
-Public Class C1\r
- Public Function f1()As Integer\r
- Return 1\r
- End Function\r
-\r
- Public Function fn() As Integer\r
- Return 5\r
- End Function\r
-End Class\r
-\r
-Public Class C2\r
- Inherits C1\r
- Public Function f2()As Integer\r
- Return f1()\r
- End Function\r
-End Class\r
-\r
-Public Class c3\r
- Inherits C2\r
-End Class\r
-\r
-Module Inheritance\r
- Sub Main()\r
-\r
- Dim c1 As New C1()\r
- Dim a As Integer=c1.f1()\r
- If a<>1 Then\r
- Throw New Exception("#A1- Inheritence:Failed")\r
- End If\r
-\r
- Dim c2 As New C2()\r
- Dim b As Integer = c2.f1()\r
- Dim c As Integer = c2.f2()\r
- Dim d As Integer = c2.fn()\r
-\r
- If b<>1 Then\r
- Throw New Exception("#A2- Inheritence:Failed")\r
- End If\r
- If c<>1 Then\r
- Throw New Exception("#A2- Inheritence:Failed")\r
- End If\r
- If d<>5 Then\r
- Throw New Exception("#A2- Inheritence:Failed")\r
- End If\r
-\r
-\r
- Dim c3 As New c3()\r
- b=c3.f1()\r
- c=c3.f2()\r
- d=c3.fn()\r
-\r
- If b<>1 Then\r
- Throw New Exception("#A3- Inheritence:Failed")\r
- End If\r
- If c<>1 Then\r
- Throw New Exception("#A3- Inheritence:Failed")\r
- End If\r
- If d<>5 Then\r
- Throw New Exception("#A3- Inheritence:Failed")\r
- End If\r
-\r
- End Sub\r
-End Module\r
+Imports System
+
+'Testing simple and multi-level inheritence with all methods declared public
+
+Public Class C1
+ Public Function f1()As Integer
+ Return 1
+ End Function
+
+ Public Function fn() As Integer
+ Return 5
+ End Function
+End Class
+
+Public Class C2
+ Inherits C1
+ Public Function f2()As Integer
+ Return f1()
+ End Function
+End Class
+
+Public Class c3
+ Inherits C2
+End Class
+
+Module Inheritance
+ Sub Main()
+
+ Dim c1 As New C1()
+ Dim a As Integer=c1.f1()
+ If a<>1 Then
+ Throw New Exception("#A1- Inheritence:Failed")
+ End If
+
+ Dim c2 As New C2()
+ Dim b As Integer = c2.f1()
+ Dim c As Integer = c2.f2()
+ Dim d As Integer = c2.fn()
+
+ If b<>1 Then
+ Throw New Exception("#A2- Inheritence:Failed")
+ End If
+ If c<>1 Then
+ Throw New Exception("#A2- Inheritence:Failed")
+ End If
+ If d<>5 Then
+ Throw New Exception("#A2- Inheritence:Failed")
+ End If
+
+
+ Dim c3 As New c3()
+ b=c3.f1()
+ c=c3.f2()
+ d=c3.fn()
+
+ If b<>1 Then
+ Throw New Exception("#A3- Inheritence:Failed")
+ End If
+ If c<>1 Then
+ Throw New Exception("#A3- Inheritence:Failed")
+ End If
+ If d<>5 Then
+ Throw New Exception("#A3- Inheritence:Failed")
+ End If
+
+ End Sub
+End Module