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

Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Overloading query" Watch "Overloading query" New topic

Overloading query

Abhinaba Basu

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://""" target="_blank" rel="nofollow">Kaizen Informatics Pvt Ltd</a><br /><a href="http://""" target="_blank" rel="nofollow">My site</a> | <a href="http://""" target="_blank" rel="nofollow">My Blog</a> | <a href="http://""" target="_blank" rel="nofollow">My office</a>
marc weber

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
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.
Have you tried LearnNowOnline?
subject: Overloading query