Murach's Visual Basic 2008
How to work with inheritance

This chapter shows you how inheritance is used throughout the .NET classes and how you can use inheritance in your own Visual Basic classes. When you're done, you'll know how to create base and derived classes, how polymorphism works, and how to use casting with inheritance. To make sure that you get all of that, this chapter presents a complete application that uses a Product base class, Book and Software derived classes, and a ProductList class that inherits the List() class. Wow!

Chapter 18 How to work with inheritance
An introduction to inheritance 572
How inheritance works 572
How the .NET Framework uses inheritance 574
Methods inherited from the System.Object class 576
How to use inheritance in your applications 578
Basic skills for working with inheritance 580
How to create a base class 580
How to create a derived class 582
How polymorphism works 584
An inheritance version of the Product Maintenance application 586
The operation of the Product Maintenance application 586
The code for the Product, Book, and Software classes 588
The code for the ProductList class 592
The code for the Product Maintenance form 594
The code for the New Product form 596
Object types and casting 598
How to use the Type class to get information about an object's type 598
How to use casting with inheritance 600
How to work with abstract and sealed classes 602
How to work with abstract classes 602
How to work with sealed classes 604




Murach's VB 2008

Learn more about this book

View the table of contents

Add this book to your cart



Our Ironclad Guarantee

First, try our books for 90 days. Then, if you aren't completely convinced that our books are the best ones you've ever used, you can return them for a full refund...no questions asked.