There is a task which I don't unterstand
Possible Code
A) Object x = t.find(123, "456");
B) int x = t.find(123, new Double(456));
C) int x = t.find(123, new Integer(456));
D) int x = (int)t.find(new Double(123), new Double(456));
In my opinion C and D are valid.
In fact A and C are valid.
So, why is A correct?
I thought you define with the first parameter the type for the metho.
So, in C the type is defined by the first parameter -> int therefore the second parameter must be an Integer as well.
For the same reason, I thougt D was correct as well.
Can anyone explain that?
mfg alex