I have been coding few examples on method overloading and method overridng.
Method overloading is static polymorphism and overriding is dynamic polymorphism.
So any error related to overloading will be caught at the compile time..Correct ?or are there any scenarios when a runtime exception is thrown because of incorrect overloading — I Doubt
Any errors related to method overriding( — incase when the child class method has same name as Base class and same arguments as of base class —- )will be thrown at compile time .
Are there any scenarios in both the above cases where there is a exception at run time ?
I cannot imagine how method overloading can cause a runtime exception.
Some scenarios when incorrect/incomplete method overriding can cause runtime exceptions: