File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Integer... and int... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Integer... and int..." Watch "Integer... and int..." New topic

Integer... and int...

Alina Petra

Joined: Oct 17, 2006
Posts: 26
If a class has the following two overloaded methods:

The compiler complains about the ambiguous method when one tries to call method(1).

Could anyone explain why?
wise owen
Ranch Hand

Joined: Feb 02, 2006
Posts: 2023
Why overloading a varargs method doesn't work for the primitive type and its object wrapper type?
anil kuchana
Ranch Hand

Joined: Sep 08, 2000
Posts: 404
the point is using varargs is same as passing an array, just it hides the process..
in the above code the compiler just sees two arrays which are not more specific than other..
[ October 25, 2006: Message edited by: anil kuchana ] Home of Java Skills SCJP 5.0, SCBCD, SCEA mock exams
I agree. Here's the link:
subject: Integer... and int...
It's not a secret anymore!