December 2017
Beginner
372 pages
10h 32m
English
An abstract class is a special type of class, which does not need to have an implementation of all the methods it defines. The primary use of an abstract class is to have a base class that defines all the common behaviors and lets the child classes manage the differences. This concept is very useful in writing large-scale object-oriented applications, where we want to define the behavior of a parent entity.
The following example shows how to define an abstract class and abstract methods:
abstract class Book { constructor(public author:string, public title:string, public length: number){ } abstract getFullTitle(): string ;}
To define a class as abstract, we just need to prefix the class name with the abstract keyword; the ...
Read now
Unlock full access