Skip to main content

Classes and Inheritance

  • Chapter
Illustrated C# 2008
  • 457 Accesses

Abstract

Inheritance allows you to define a new class that incorporates and extends an already declared class.

  • You can use an existing class, called the base class, as the basis for a new class, called the derived class. The members of the derived class consist of the following:

    • The members in its own declaration

    • The members of the base class

  • To declare a derived class, you add a class-base specification after the class name. The class-base specification consists of a colon, followed by the name of the class to be used as the base class. The derived class is said to directly inherit from the base class listed.

  • A derived class is said to extend its base class, because it includes the members of the base class plus any additional functionality provided in its own declaration.

  • A derived class cannot delete any of the members it has inherited.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 34.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 44.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Rights and permissions

Reprints and permissions

Copyright information

© 2008 Daniel Solis

About this chapter

Cite this chapter

(2008). Classes and Inheritance. In: Illustrated C# 2008. Apress. https://doi.org/10.1007/978-1-4302-0574-6_7

Download citation

Publish with us

Policies and ethics