Which of the following JavaScript code snippets correctly defines
two classes A
and B
, such that B
is a subclass of A
? Select one:
O
class A { constructor (a) { this.propA = a; } } class B extends A { constructor (b) { this.propB = b; } }
O
class A { constructor (a) { this.propA = a; } } class B extends A { constructor (b) { super( b) this.propB = b; } }
O
class A { constructor (a) { this.propA = a; } } class B extends A { constructor (a,b) { super( a) this.propB = b; } }
O
class A extends B { constructor (a) { this.propA = a; } } class B { constructor (a,b) { super( a) this.propB = b; } }
Consider the three classes A
with a property
propA
, B
with a property propB
and C
with a property propC
, such that
B
and C
are subclasses of A
.
Which of the following class definitions is the correct result of
merging all three classes according to the Class
Hierarchy Merge design pattern? Select one:
O
ACategoryEL = new Enumeration(["B","C"]);
class Abc {
constructor (a,b,c) {
this.propA = a;
if (b) this.propB = b;
if (c) this.propC = c;
}
}
O
ACategoryEL = new Enumeration(["B","C"]);
class Abc {
constructor (a,cat,b,c) {
this.propA = a;
this.category = cat; // from ACategoryEL
if (b) this.propB = b;
if (c) this.propC = c;
}
}
O
ACategoryEL = new Enumeration(["B","C"]);
class Abc {
constructor (a,cat,b,c) {
this.propA = a;
this.category = cat; // from ACategoryEL
this.propB = b;
this.propC = c;
}
}
O
ACategoryEL = new Enumeration(["B","C"]);
class Abc {
constructor (a,cat) {
this.propA = a;
this.category = cat; // from ACategoryEL
}
}
Recall that in a class resulting from applying the Class Hierarchy Merge design pattern, we have segment properties corresponding to the specific properties of the merged segment classes (subclasses).
How many parameters does the check method for a segment property have? Select one:
O one
O two
O three