File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ambiguous reference

 
Terrence White
Ranch Hand
Posts: 39
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I compile and run this code:

I get: BC
When I compile this code:

I get:
reference to m is ambiguous, both method m(A,B) in C and method m(C,A) in C match
m(null,null);
^
1 error
Why don't I get: CA ?
CA seems more specific than AB.

Also,
When I compile this code:

I get:
reference to m is ambiguous, both method m(A,C) in C and method m(B,B) in C match
m(null,null);
^
1 error
How do I figure how when the compiler will
chose one of the methods, and when I will get
the ambiguous reference error?
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic