Call a method on a Super Class in Scala
This concept is used when we want to call super class method. So whenever a base and subclass have same named methods then to resolve ambiguity we use super keyword to call base class method. The keyword “super” came into this with the concept of Inheritance.
Below is the example of call a method on a superclass.
I'm reading I'm writing
In above example, we are calling multiple method of super class by using super keyword.
This is student class This is person class
In the above example, we have seen that if we only call method
message() then, the current class
message() is invoked but with the use of super keyword,
message() of super class could also be invoked.