• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Doubt in ambiguous method calls

 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
source: http://www.javablackbelt.com/


Why doesn't the compiler complain about ambiguous method call? Instead it compiles fines and prints String Version. Why not Object Version?
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
See our SCJP FAQ: What is a most-specific method?
 
sridhar row
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Marc. I also found this link https://coderanch.com/t/267889/java-programmer-SCJP/certification/overloading to be very helpful and a very nice explanation by you!!
 
marc weber
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by sridhar row:
Thanks Marc. I also found this link https://coderanch.com/t/267889/java-programmer-SCJP/certification/overloading to be very helpful and a very nice explanation by you!!


Excellent, I'm glad it helped!
 
Ranch Hand
Posts: 145
Oracle Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for appropriate FAQ. Its one of the richest forums.
Thansk to creators
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic