aspose file tools*
The moose likes Beginning Java and the fly likes Overloading query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Overloading query" Watch "Overloading query" New topic
Author

Overloading query

Abhinaba Basu
Greenhorn

Joined: Jun 06, 2006
Posts: 15
My code is given below:



And it is printnig "String"

And my next code is give below:



Why it is doing like this? Can anybody explain me?


<b>Abhinaba basu</b><br />Software Engineer,<br /><a href="http://"http://www.kaizen-it.com"" target="_blank" rel="nofollow">Kaizen Informatics Pvt Ltd</a><br /><a href="http://"http://engineers.bizhat.com"" target="_blank" rel="nofollow">My site</a> | <a href="http://"http://theabhinaba.bizhat.com"" target="_blank" rel="nofollow">My Blog</a> | <a href="http://"http://www.kaizen-it.com"" target="_blank" rel="nofollow">My office</a>
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

See if this helps: Most specific method.


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
vidya sagar
Ranch Hand

Joined: Mar 02, 2005
Posts: 580
Normally in this scenario,More appropriate matching method will be called.

In the First Case,String is more appropriate. so the method with string argument is called.

But in the Second Case,String and StringBuffer is in same level so the compiler cannot know which one to choose.So it throws ambiguous error.
 
 
subject: Overloading query