CIS 35A: Introduction to Java Programming

Home | Green Sheet | Lectures | Assignments | FAQ | Grades

Inheritance

Inheritance
Introduction
Java API

How the Java API uses inheritance

  • The Java API uses inheritance extensively in its own classes, so you often need to know what the inheritance hierarchy is as you use these classes. Examples:
  • All classes ultimately inherit the Object class in the java.lang package.
  • All Swing classes, which are stored in the javax.swing package, inherit the Component and Container classes in the java.awt package. This package contains the Abstract Windows Toolkit (AWT) classes.
  • A class can use the fields and methods of any of its superclasses.

Previous | How inheritance works | Java API | Object class | Use | Next