mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-08-31 13:01:43 +02:00
Fix typo in Method Overriding in Typescript (#4306)
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
In TypeScript, method overriding is a mechanism where a subclass provides a new implementation for a method that is already defined in its parent class. This allows the subclass to inherit the behavior of the parent class, but change its behavior to fit its own needs.
|
In TypeScript, method overriding is a mechanism where a subclass provides a new implementation for a method that is already defined in its parent class. This allows the subclass to inherit the behavior of the parent class, but change its behavior to fit its own needs.
|
||||||
|
|
||||||
To override a method in TypeScript, you need to use the `override` keyword, and the signature of the method in the subclass must match exactly with the signature of the method in the parent class.
|
To override a method in TypeScript the signature of the method in the subclass must match exactly with the signature of the method in the parent class.
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
class Animal {
|
class Animal {
|
||||||
|
Reference in New Issue
Block a user