This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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

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-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
Similar Threads
why variables inside interface has to final
Making 2-D array from 1-D Array.
can parent class constructor be invoked using this operator?
passing Array between methods