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() 

+ Answer
+ Report
Total Preview: 12

Copyright © 2024. Powered by Intellect Software Ltd