Below is the code
package org.nagark;
class baseClass{
public void callMtd(int i){
System.out.println("integer method"+i);
}
public void callMtd(double d){
System.out.println("double method"+d);
}
}
public class OverRidingExample {
/**
* @param args
*/
public static void main(String[] args) {
baseClass bc = new baseClass();
bc.callMtd(10/3);
}
}
In OverRidingExample
class I am calling baseClass.callMtd
method with argument 10/3(as you can see in the code). As callMtd is overloaded in baseClass, which version should be called by default? as it is overloaded method binding should happen at compile time but can computation of 10/3 happen at compile time?