wood burning stoves 2.0*
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 Android Security Essentials Live Lessons this week in the Android 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.
Don't get me started about those stupid light bulbs.
subject: var-arg and array problem
Similar Threads
passing Array between methods
why variables inside interface has to final
Making 2-D array from 1-D Array.
can parent class constructor be invoked using this operator?