This is how I tested it:

Module Module1

  Sub Main()

    Dim test As T = New X
    test.Run()

    Console.Read()

  End Sub

End Module

Class T
  Public Sub Run()

    Console.WriteLine("T.Run()")

  End Sub

End Class

Class X
  Inherits T

  Public Overloads Sub Run()

    Console.WriteLine("X.Run()")

  End Sub


End Class

When I ran this code, the console wrote out:

T.Run()

This leads me to believe that Sub Run is virtual by default, no?

Thanks,

Shawn Wildermuth
Wildermuth Consulting Services, LLC
http://adoguy.com
C# MVP, MCSD.NET, Author and Speaker


> -----Original Message-----
> From: Discussion of advanced .NET topics.
> [mailto:[EMAIL PROTECTED] On Behalf Of Barry Kelly
> Sent: Friday, July 07, 2006 10:12 PM
> To: [email protected]
> Subject: Re: [ADVANCED-DOTNET] Virtual methods in .NET - was
> Implementing an Interface - C# vs. VB.NET
>
> I just tried it with a simple file:
>
> Imports System
>
> Public Class App
>
>     Shared Sub Main()
>         Console.WriteLine("Hello World")
>     End Sub
>
>     Public Sub Foo()
>     End Sub
>
> End Class
>
> And peeked in .NET Reflector. I may have done something wrong
> - I'm a complete novice in VB.NET.
>
> -- Barry

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to