aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Doubt with compiler error about method matching Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Doubt with compiler error about method matching" Watch "Doubt with compiler error about method matching" New topic
Author

Doubt with compiler error about method matching

Ada Lopez
Greenhorn

Joined: Apr 14, 2011
Posts: 7
Hello friends!

I was studying K&B´s Overloading Made Hard section in Chapter 3.
There´s no problem with this code:


a
But then I wondered which one of these two would pick if they were overloaded and surprise!!! It gives a compiler error (ambiguous, both method match) and I don´t understand why the compiler can´t choose:



Please, anyone knows why?

Starting to blog my progress ... in Spanish, sorry.
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9317
    
  17

Go through this topic. From the rules listed out by Anand, read the 4th rule...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Ada Lopez
Greenhorn

Joined: Apr 14, 2011
Posts: 7
Thanks so much!! This is what I was looking for!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Doubt with compiler error about method matching