Saturday, December 10, 2011

Saturday 12/10/2011

'this type is in the root namespace,
' which is (by default) the same name
'as the initial project

Public Class SomeClass
End Class

'this naemspace is nested within the root. therefore the fully
'qualified name of this class is MyCodeLibrary.MyTypes.SomeClass
Namespace MyTypes
Public Class SomeClass
End Class

'it is possible to nest namespaces within other namespaces to gain a greater level of structure
'thus the fully qualified name of this enum is
'MyCodeLibary.MyTypes.MyEnums.TestEnum
Namespace MyEnums
Public Enum TestEnum
TestValue
End Enum
End Namespace
End Namespace

Imports System.Windows.Forms

Public Class SportsCar
Inherits Car

Public Sub New()
End Sub

Public Sub New(ByVal carName As String, ByVal max As Short, ByVal curr As Short)
MyBase.New(carName, max, curr)
End Sub


Public Overrides Sub TurboBoost()
MessageBox.show("Ramming speed!", "Faster is better...")
End Sub
End Class

Public Class MiniVan
Inherits Car

Public Sub New()

End Sub

Public Sub New(ByVal carName As String, ByVal max As Short, ByVal curr As Short)
MyBase.New(carName, max, curr)
End Sub

Public Overrides Sub TurboBoost()
'minivans have poor turbo capabilities!
egnState = EngineState.engineDead
MessageBox.Show("Time to call AAA", "Your car is dead")
End Sub
End Class

No comments: