Murach's C++ 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 C++ classes. When you're done, you'll know how to create base and subclasses, 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 subclasses, and a ProductList class that inherits the List<> class (one of the typed collection classes). Wow!

Chapter 14 How to work with inheritance
An introduction to inheritance 394
How inheritance works 394
How the .NET Framework uses inheritance 396
Methods inherited from the System::Object class 398
How to use inheritance in your applications 400
Basic skills for working with inheritance 402
How to create a base class 402
How to create a derived class 404
How polymorphism works 406
An inheritance version
of the Product Maintenance application
408
The operation of the Product Maintenance application 408
The code for the Product, Book, and Software classes 410
The code for the ProductList class 414
The code for the Product Maintenance form 416
The code for the New Product form 418
Object types and casting 420
How to use the Type class
to get information about an object's type
420
How to use casting with inheritance 422
How to work with abstract and sealed classes 424
How to work with abstract classes 424
How to work with sealed classes 426




Murach's C++ 2008

Learn more about this book

View the table of contents


More about the eBook



Our 100% 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 prompt refund...no questions asked.