Sunday, July 25, 2010

A Cat is always a Pet but a Pet is not always a Cat

An array of pets:
Dim MyPets (8) As Pet
MyPets (0) = New Dog ()
MyPets (1) = New Cat ()

PublicSubNew (APet As Pet)

Declaring a pet

Dim ThisCat As New Cat
Dim ThisDog As New Dog

No comments:

Post a Comment