I have a function:
draw(int[] a)
{
//...
}
and I want to pass in the array {3,4,5}
. Why can't I call:
draw({3,4,5});
The type of {3,4,5}
is ambiguous (could be int[]
, short[]
, long[]
, etc..). Try:
draw(new int[]{3,4,5});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With