I wrote this test code
public class ConstructorTestApplication {
private static String result;
public static void main(String[] args) {
ConstructorTest test1 = new ConstructorTest(0);
System.out.println(result);
}
private static class ConstructorTest {
public ConstructorTest(double param){
result = "double constructor called!";
}
public ConstructorTest(float param) {
result = "float constructor called!";
}
}
}
The result was
float constructor called!
Why was the float constructor called rather than the double constructor? Is this part of the dynamic method lookup?