This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
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
Author

var-arg and array problem

Mohit G Gupta
Ranch Hand

Joined: May 18, 2010
Posts: 634



output:

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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: var-arg and array problem