Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Conclusion

We’ve covered quite a bit in this chapter. Let’s recap. First you learned that a class is a blueprint for an object; the actual object is a manifestation (or instance) of that class. A class can inherit capabilities from a parent, or base, class. A class has properties that contain information about its state, such as its size or color. The internal variables that hold the properties are called fields when they are referred to inside the class. A class also has code that instructs it to do things. From outside the class, these actions are known as methods. Inside the class, subroutines and functions implement a class’s methods.

A class has a constructor, Sub New, that builds an object of the class, as well as a destructor, Sub Dispose, that tears down the class. When you want a new instance of a class, the New keyword usually will call a function named Sub Main, which in turn calls Sub New. If the class inherits from a parent class, the first line in the constructor calls the constructor of the parent class. All of the base classes are instantiated from top to bottom, with our class being last.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint