Method Overriding

Here in the child class , the return type and the argument datatype of the method is changed from "int" to "double" , so the compiler shows an error

You can visualise method overriding like below -

Last updated

Was this helpful?