Chapter 3. Object-oriented programming with classes and interfaces

This chapter covers

  • How class inheritance works
  • Why and when to use abstract classes
  • How interfaces can force a class to have methods with known signatures without worrying about implementation details
  • What “programming to interfaces” means

In chapter 2, we introduced classes and interfaces for creating custom types. In this chapter, we’ll continue learning about classes and interfaces from the object-oriented programming (OOP) perspective. OOP is a programming style where your programs focus on handling objects rather than on composing actions (think functions). Of course, some of those functions would create objects as well, but in OOP, objects are the center of the universe. ...

Get TypeScript Quickly now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.