Declaration and Instantiation (VB.NET Style)

A declaration-instantiation statement is used to create a Jeroo object. The declaration-instantiation statements must appear in the main method before any other statements.

A declaration-instantiation statement has the form
   Dim identifier As Jeroo = new Jeroo( arguments )
There are six constructors as shown in the following table.

Example

Attributes

Dim kim As Jeroo= new Jeroo()


Accept default attributes
Name: kim
Location: (0,0)
Direction: EAST
Flowers: 0
Dim kim As Jeroo = new Jeroo(8)


Specify the flowers
Name: kim
Location: (0,0)
Direction: EAST
Flowers: 8
Dim kim As Jeroo = new Jeroo(3,4)


Specify the location
Name: kim
Location: (3,4)
Direction: EAST
Flowers: 0
Dim kim As Jeroo = new Jeroo(3,4,WEST)


Specify location and direction
Name: kim
Location: (3,4)
Direction: WEST
Flowers: 0
Dim kim As Jeroo = new Jeroo(3,4,8)


Specify location and flowers
Name: kim
Location: (3,4)
Direction: EAST
Flowers: 8
Dim kim As Jeroo = new Jeroo(3,4,SOUTH,8)


Specify all attributes
Name: kim
Location: (3,4)
Direction: SOUTH
Flowers: 8