0
int a [0] = int b [1];

I get this error.

Type mismatch: cannot convert from int to int[]

Edited by marvolo1300: n/a

2
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by marvolo1300
0

I got bored of waiting so i checked out some VB tuts on daniweb, and found out that braces initialize arrays.

int a [] = {int b [1]};

Edited by marvolo1300: n/a

0

Don't know what VB has to do with Java syntax.
In Java the {} thing is to define a literal array, eg

int[] a = {1,2,3};

To assign one element of an array to another its just

a[i] = b[j];
0

Don't know what VB has to do with Java syntax.
In Java the {} thing is to define a literal array, eg

int[] a = {1,2,3};

To assign one element of an array to another its just

a[i] = b[j];

Ty for your help.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.