Which method gets called when multiple overloads are legal?

With method overloading (as is in use here), the method to call is resolved at compile time, based on the (declared) type of the variable holding the Sprite Since the method call is ambiguous, this will fail to compile until you manually downcast the reference to resolve the ambiguity.

With method overloading (as is in use here), the method to call is resolved at compile time, based on the (declared) type of the variable holding the Sprite. Since the method call is ambiguous, this will fail to compile until you manually downcast the reference to resolve the ambiguity.

Good to know, thanks. – CodeBunny Feb 22 at 12:36 1 I think this link goes into a little more detail: java.sun. Com/docs/books/jls/third_edition/html/… – johusman Feb 22 at 12:38 @johusman: to be precise: it goes into *all the detail there is, by definition ;-) – Joachim Sauer Feb 22 at 15:31.

It's ambiguous. You'll need to cast to one of the interfaces.

Interface A {} interface B {} class Sprite implements A,B {} class Test{ void foo(A a){} void foo(B b){} void test(){ Sprite s = new Sprite(); foo(s).

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions