this is not function overriding
this is called as function overloading
How to know whether a method is overloading method : -
The name of method is same as that of another method The argument list must be different in overloadingThe return can change but if only return type is changed, that is not a legal overload
Overriding : -
The method arguments list must be same The return type should be same
here in this case
the doIt method in class Electronic is overriding the doIT method in interface device
and the doIt(int i ) method is overloading the method doIt in interface device
hope this helps
happy coding
SCJP 6 [86%], OCPWCD [84%], OCEJPAD [83%]
If you find any post useful, click the "plus one" sign on the right