I self-medicate in the summer, and I ran into this problem, which I am not sure about, and I was wondering if anyone could help. I am not sure about the last issue, but I have included my previous answers if someone wants to check them. This is not homework for any class, I just want to make sure that I understand what I am doing before moving on.
I consider the following definitions:
1. void m (Object o, long x, long y) 2. void m (String s, int x, long y) 3. void m (Object o, int x, long y) 4. void m (String s, long x, int y)
which these ads:
Object o; String v; int a; long b;
and I consider these challenges:
m(v,a,b); Calls 2, because it is the most specific. m(v,a,a); Not legal, because 2 and 4 could both be called (not specific enough). m(v,b,a); Calls 4, because it is the most specific. m(v,b,b); Calls 1, because it is the only one that will fit (long cannot shorten to int). m(o,b,b); Calls 1, similar reasoning as above answer. m(o,a,a); Unsure. I'm not sure of the precedence.
Thanks in advance!
user2218130
source share