Skip to content · ⁨الانتقال إلى المحتوى⁩
English

Build on an existing class

  • Inheritance lets a new class reuse an existing one.
  • The new class is the subclass (child); the original is the superclass (parent).
  • Write class Bird(Animal): — Bird gets all of Animal's methods. (In exam pseudocode: CLASS Bird INHERITS Animal.)

العربية

البناء على فئة موجودة

  • الوراثة تسمح للفئة الجديدة بإعادة استخدام فئة موجودة.
  • الفئة الجديدة هي الفئة الفرعية (الابن)؛ الأصلية هي الفئة الأب (الأم).
  • اكتب class Bird(Animal): — Bird ستحصل على جميع Animal's طرق. (في الكود الوهمي للامتحان: CLASS Bird INHERITS Animal.)

حيوان أب مع describe(); الطائر والبقرة يرثانه، إضافة أو استبدال طرق

Handout · ⁨ورقة عمل⁩

Log in or create account · ⁨تسجيل الدخول أو إنشاء حساب⁩

IGCSE, A-Level & AP