• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

var-arg and array problem

 
Mohit G Gupta
Ranch Hand
Posts: 634
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


output:

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

please explain ?
 
Chinmaya Chowdary
Ranch Hand
Posts: 432
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Mohit.


Here var-args internally represented as array, like

Compiler will do this. There is a conflict. There should be one.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic