Question:which of the following code shows override method?
class A { add(a,b){ return a+b; } print() { console.log("class A"); } } class B extends A { print() { console.log("class B"); } sub(a,b){ return a-b; } parentPrint() { super.print(); } }
A print()
B add()
C parentPrint()
D sub()
+ AnswerA
+ Report