By Jesse Liberty
Book Price: $34.95 USD
£24.95 GBP
PDF Price: $27.99
Cover | Table of Contents | Colophon
If, While,
For, and so forth. You'll learn
about these keywords in the coming chapters.
Module HelloWorld
' every console app starts with Main
Sub Main( )
System.Console.WriteLine("Hello world!")
End Sub
End Module
Module HelloWorld
' every console app starts with Main
Sub Main( )
System.Console.WriteLine("Hello world!")
End Sub
End Module
vbc helloworld.vb
Module HelloWorld
Module
keyword, as in the preceding code line. Likewise, you end each module
definition with the line:
End Module
Class Dog Private weight As Integer ' weight is an integer Private name As String ' the Dog's name as text
Class Dog Private weight As Integer ' weight is an integer Private name As String ' the Dog's name as text Public Sub bark( ) 'code here to bark End Sub
Public and Private are
known as access modifiers, which are used to
specify what classes can access particular members. For instance,
public members can be called from methods in any class, while private
members are visible only to the methods of the class that defines the
member. Thus, objects of any class can call bark on a Dog, but only
methods of Dog have access to the weight and name of the Dog. Access
modifiers are discussed in Chapter 8.