wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes var args method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "var args method" Watch "var args method" New topic
Author

var args method

aswin penugonda
Greenhorn

Joined: Jun 16, 2009
Posts: 9


Can any one explain me why there is ambiguity in m1 method call


SCJP-93% (310-055)
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

SCJP-93% (310-055)


Should you not know this answer already ? ;)

Hint: Will a byte fit into an int ?


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Shanky Sohar
Ranch Hand

Joined: Mar 17, 2010
Posts: 1051

aswin penugonda wrote:
Can any one explain me why there is ambiguity in m1 method call



we cannot mix the overloading var args and widening............


SCJP6.0,My blog Ranchers from Delhi
Vlado Zajac
Ranch Hand

Joined: Aug 03, 2004
Posts: 245
There should be no ambiguity since byte... is more specific than int... .

It looks like this compiler bug.
Abimaran Kugathasan
Ranch Hand

Joined: Nov 04, 2009
Posts: 2066

Well, try this too!


|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: var args method
 
Similar Threads
How to store method return type in primitive
AWT: Painting buttons
Specific method call
More specific method
Overloading with var-args