Method overriding, in object-oriented programming, is a language feature that allows a subclass or child class to provide a specific implementation of a method that is already provided by one of its superclasses or parent classes.
Method overriding is a feature of Object-oriented programming approach. It helps to achieve polymorphism. We can achieve method overriding using inheritance.
type Employee() =
abstract ShowName : unit -> unit
default this.ShowName() = printfn"This is base class method"
type Manager() =
override this.ShowName() = printf "This is derived class method"
let employee = new Employee()
let manager = new Manager()
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.