Complete the code to declare an abstract class named Animal.
abstract class [1] { abstract makeSound(): void; }
The keyword abstract is used to declare an abstract class. Here, the class name should be Animal.
Complete the code to correctly extend the abstract class Animal.
class Dog extends [1] { makeSound(): void { console.log('Woof!'); } }
The class Dog extends the abstract class Animal to provide an implementation for the abstract method.
Fix the error in the code by completing the blank with the correct keyword to prevent instantiation of the class.
[1] class Animal { makeSound(): void { console.log('Some sound'); } } const animal = new Animal();
Marking the class as abstract prevents it from being instantiated directly.
Fill both blanks to declare an abstract method move in the abstract class Vehicle.
abstract class Vehicle { [1] [2](): void; }
The method is declared as abstract and named move without a body in the abstract class.
Fill all three blanks to implement the abstract method move in the subclass Car.
class Car extends Vehicle { [1] [2](): void { console.log('[3] fast'); } }
The subclass Car uses the override keyword to implement the abstract method move and logs 'drives fast'.