Class B extends class A and Class C extends class B, therefore method m1() is overdidden right?. But according to the output, method m1() is overloaded. Some one please explain how method m1() is overloaded and not overridden.
method parameters are different.so it is method overloading.Overridden method signature must be same.
Note: In Java 1.5 the return type of the overriding method can be different. When you override a method, the declared return type can be any subclass of the the class returned by the original method. Currently, the method signature of an overriding method has to match exactly that of the method that it is overriding, including the return type.