Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons
  • Teach on BraveProgrammer

© 2026 BraveProgrammer. All rights reserved.

Class Inheritance & Abstract Cla | TypeScript Mastery lesson | BraveProgrammer
  1. Courses
  2. /
  3. TypeScript Mastery

Lesson 18 of 56

·Typescript

Class Inheritance & Abstract Classes

20 minutes

Course progress32%

Inheritance

class Employee extends Person {
  private employeeId: string;
  constructor(name: string, : , : , : ) {
    (name, ssn, birthYear);
    . = employeeId;
  }
  () {  .; }
}
ssn
string
birthYear
number
employeeId
string
super
this
employeeId
getId
return
this
employeeId

Abstract Classes

abstract class Shape {
  abstract area(): number; // must be implemented by subclasses
}

class Circle extends Shape {
  constructor(public radius: number) { super(); }
  area() { return Math.PI * this.radius ** 2; }
}

instanceof Checks

function isShape(x: any): x is Shape {
  return x instanceof Shape;
}

Info

Abstract classes are useful when you need shared implementation plus enforced contract.
Make it stickPractice what you've learned1 quiz · 3 practical tests · Optional activities from TypeScript MasteryBrowse activities
Previous lessonClasses – Public, Private, ProtectedContinue to lesson 19Accessors (get/set) & Readonly PropertiesBack to TypeScript Mastery curriculum