Overrides ToString function
Public Class Temperature Private temp As Decimal Public Sub New(temperature As Decimal) Me.temp = temperature End Sub Public Overrides Function ToString() As String Return Me.temp.ToString("N1") + " Degree" End Function End Class Module Example Public Sub Main() Dim currentTemperature As New Temperature(23.6d) Console.WriteLine("The current temperature is {0}.", currentTemperature) End Sub End Module