Two Laptop Bag
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
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "var args method" Watch "var args method" New topic

var args method

aswin penugonda

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

Joined: Feb 24, 2006
Posts: 6662

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%|
I agree. Here's the link:
subject: var args method
It's not a secret anymore!