Unnamed Package


  • Class
    Description
    Abstract base class combining shared state, a concrete default method, and an abstract method subclasses must implement.
    Base class exposing an overridable speak() method.
    Animal subclass that overrides speak() to meow.
    Animal subclass that overrides speak() to bark.
    Concrete AbstractAnimal that implements the required speak() method.
    ISpeaker implementation that meows.
    ISpeaker implementation that barks.
    Interface contract for a single, non-substitutable speaker.
    Interface contract for anything that can speak.
    Demonstrates inheritance-based polymorphism resolved via the JVM's per-class virtual method table (vtable).
    Demonstrates inheritance-based polymorphism where a concrete default method is inherited unchanged alongside an abstract method that must be overridden.
    Demonstrates interface-based polymorphism resolved via the JVM's itable (interface method table) rather than a class vtable.
    Demonstrates monomorphic dispatch: because PureBreedDog is final, the JIT can devirtualize the call and invoke speak() directly, without an itable/vtable lookup.
    Sealed 'final' class ensures NO other subclass can modify this method path.