Howdy, cowboys!
You cannot override constructors, because they are not inherited.
You are talking about over
loading - and be prepared for text-only questions that will
test your knowledge about nomenclature as well.
You should not mix the technical terms, not even in talking to your co-ranchers.
The question does not necessarily has anything to do with constructors at all, the same would work with methods:
prints:
int
float
In the first part, no type conversion is needed, so
foo just takes an int as the int number.
In the second part, there is no bar method for an int parameter, so in this case the compiler takes the "slowest"
higher method possible.
Quizzzzz:
What constructor will be chosen here?
;)
Yours,
Bu