Medium
Can an interface inherit from another interface? Can an interface inherit from another class?
Author: Eric HostaleryStatus: PublishedQuestion passed 1325 times
Edit
3
Community Evaluations
Vincent
16/10/2021
La réponse : oui uniquement d'une autre interface n'est pas comptée bonne.
Pourtant une interface peut bien descendre d'une autre interface. Et une interface ne peut pas descendre d'une classe (c'est l'inverse)
Similar QuestionsMore questions about OOP
13
Is the following code valid?
class Person {
constructor(name, age) {
this.name = name;
this.age = age;
}
}
const person = new Person('John', 20);
console.log(person.name);
console.log(person.age);8
You need to develop a class for which there should be only one instance throughout your application. Which design pattern should you use for this?7
Can we extend an abstract class in Java?4
Is the following code valid?
class Person {
constructor(name, age) {
this.name = name;
this.age = age;
}
}
const person = new Person('John', 20);
console.log(person.name);
console.log(person.age);3
Is the following code valid?
class Person {
constructor(name, age) {
this.name = name;
this.age = age;
}
}
const person = new Person('John', 20);
console.log(person.name);
console.log(person.age);