my dog learned polymorphism
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes var-arg and array problem 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-arg and array problem" Watch "var-arg and array problem" New topic

var-arg and array problem

Mohit G Gupta
Ranch Hand

Joined: May 18, 2010
Posts: 634


cannot declare both go(int[]) and go(int...) in Widening1
static void go(int[] a2)
1 error

please explain ?

OCPJP 6.0 93%
OCPJWCD 5.0 98%
Chinmaya Chowdary
Ranch Hand

Joined: Apr 21, 2008
Posts: 432
Hi, Mohit.

Here var-args internally represented as array, like

Compiler will do this. There is a conflict. There should be one.
I agree. Here's the link:
subject: var-arg and array problem
It's not a secret anymore!