Linked Questions

Popular Questions

How to make properties private despite interface?

Asked by At

I have declared interface:

interface IMenu {
    name: string;
    url: string;
}

And class that realizes this interfaace:

class Menu implements IMenu {
    public name;
    public url;
}

Such as properties in interface are always public, it means class that realizes this interface must contain public properties. Is it possible to make them protected or private?

Related Questions