Archived
Is a protected field or method in class C visible in a class C2 that inherits from a class C1 that inherits from C itself?
Author: Eric HostaleryStatus: ArchivedQuestion passed 1192 times
2
Community EvaluationsNo one has reviewed this question yet, be the first!
14
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);5
Which design pattern allows to dynamically add responsibilities to an object?9
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?8
Can we extend an abstract class in Java?5
Can an interface inherit from another interface?5
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);5
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);