I want to implement both the interfaces in the generic class. How do I do that?
interface first {
name: string,
age: number
}
interface second {
Use a ,
to separate the interfaces you want to implement. That gives the following class declaration :
class generics implements first, second
Here is the complete code :
interface first {
name: string,
age: number
}
interface second {
product: string,
available: boolean,
amount: number
}
class generics implements first, second {
name: string;
age: number;
product: string;
available: boolean;
amount: number;
}
Playground link