Inheritance, Interfaces and Polymorphism — Class 12 ISC Computer Science revision notes
A 4-page visual revision sheet for Inheritance, Interfaces and Polymorphism, written for Class 12 ISC Computer Science. Formulas, diagrams and the traps that cost marks, laid out to be read the night before rather than the term before. Free, and it opens inside CapCompass.
Page 1 as PDFA preview of page 1 — all 4 pages open full size in the app.
Inheritance, Interfaces and Polymorphism in one look
reusing a class without copying it, and letting one call mean different things
Inheritance is an is-a relationship
a subclass extends a superclass, taking its fields and methods without copying any code, and adding or changing what it needs
the test is the sentence: a Circle is a Shape, so Circle extends Shape; a Car has an Engine, which is composition and not inheritance
super reaches the parent: super() calls the parent constructor and must be the first statement, and super.method() calls the parent's version
a subclass constructor always runs its parent's constructor first, whether or not super() is written, so the chain builds from the top down
The forms Java allows, and the one it does not
Single: one subclass extends one superclass, the ordinary case
Multilevel: a subclass is itself extended, so the chain is three deep or more
Hierarchical: several subclasses extend the same superclass
Multiple, NOT allowed: a Java class cannot extend two classes, because a clash between two inherited versions would have no resolution; interfaces are the way round it
Multilevel inheritance, and how far a member travels
Vehicle
Car
SportsCar
Page 1 of 4. The full sheet, all 4 pages, opens free in the app.
What this Inheritance, Interfaces and Polymorphism sheet covers
Inheritance is an is-a relationship
The forms Java allows, and the one it does not
Single
Multilevel
Hierarchical
Multiple, NOT allowed
Multilevel inheritance, and how far a member travels
These notes are not a standalone PDF. CapCompass plans Computer Science chapter by chapter against your real exam dates and free hours, and when the plan reaches Inheritance, Interfaces and Polymorphism the sheet opens inside the study block itself — at the page covering the sub-topic that block is on, with the timer still running. Revision arrives at the moment the plan says revise, instead of having to be gone looking for.