super
SC-R1049Methods are overridden in situations where the implementation/logic requires certain modifications. Overriding a method and simply calling super
, i.e. the super class' implementation is redundant. It is therefore recommended that you either not override the method or modify your overriding logic.
class Child extends Parent {
override def printName(): Unit = super.printName()
}
class Child extends Parent {
override def printName(): Unit = println("Child.printName()")
}