Skip to content · ⁨דלג לתוכן⁩

Inheritance: extends, super, and overriding · ⁨יורשות: extends, super, ועיכוב (overriding)⁩

English

Inheritance: building on a class

  • Inheritance lets one class reuse another class's fields and methods.
  • The class you build on is the superclass (parent); the new class is the subclass (child).
  • A subclass is-a kind of its superclass: a Dog is an Animal.

עברית

ירושית: בנייה על בסיס מחלקה

  • ירושית מאפשרת למחלקה להשתמש בשדות ובשיטות של מחלקה אחרת.
  • המחלקה עליה נבנתה היא מחלקת האב (ההורה); המחלקה החדשה היא מחלקת הבת (הילד).
  • מחלקת בת היא סוג של מחלקת האב שלה: Dog הוא Animal.

מחלקת אב בעלי חיים; לכלב וחתול יש הרחבה של המחלקה והפרת שיטת speak()

Handout · ⁨חומר עזר⁩

Log in or create account · ⁨היכנס או צור חשבון⁩

IGCSE, A-Level & AP