How do I implement multiple interfaces in a class?

Use a , to separate the interfaces you want to implement. That gives the following class declaration :

class generics <T> implements first, second

Here is the complete code :

interface first {
    name: string,
    age: number
}

interface second {
    product: string,
    available: boolean,
    amount: number
}

class generics <T> implements first, second {
    name: string;
    age: number;
    product: string;
    available: boolean;
    amount: number;
}

Playground link

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)