How does polymorph ambiguity distinction work?
- by Pentius
Given I have a class with two constructors:
public class TestClass {
ObjectOne o1;
ObjectTwo o2;
public TestClass(ObjectOne o1) {
// ..
}
public TestClass(ObjectTwo o2) {
// ..
}
}
What happens, if I call:
new TestClass(null);
How to determine the correct method to call? And who determines that?
Are there differences between Java and other OOP languages?