Inheritance

suggest change

Introduction

Inheritance is a basic object oriented feature in which one class acquires and extends upon the properties of another class, using the keyword extends. For Interfaces and the keyword implements, see interfaces.

Syntax

Remarks

Inheritance is often combined with generics so that the base class has one or more type parameters. See Creating a Generic Class.

Inheritance

Implementing multiple interfaces

Abstract Classes

Declaring and Implementing an Interface

Using final to restrict inheritance and overriding

The Liskov Substitution Principle

Static Inheritance

Abstract class and Interface usage Is-a relation vs Has-a capability

Inheritance and Static Methods

Variable shadowing

Narrowing and Widening of object references

Programming to an interface

Overriding in Inheritance

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents