Language Elements


  • Single inheritance rooted in common class Object

  • Subclassing builds new types
    public class ExitableFrame
    extends java.awt.Frame { ... }

  • Support for mix-in "inheritance" via Interfaces enhances opportunities for reuse

  • Strongly type checked
    • Most type checking performed statically
    • Assignment type compatibility checked dynamically (if necessary)

  • Access protection for classes, fields and methods

Detailed Description:

"With inheritance we have the ability to define a class by extending it from another class. We can define a brand-new Frame called an ExitableFrame. I developed that; it's not built into the system. Thereafter, we would say 'extends java.awt.Frame'. This could represent any class that we want to be extended. In this case, we're extending a specific class provided as part of the GUI library -- the Abstract Window Toolkit or AWT. The package name is java.awt and the class name is Frame. This is an explicit reference to a class. Later we'll talk about implicit references by using the import statement."