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

I get this error.

Type mismatch: cannot convert from int to int[]

Recommended Answers

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];
Jump to Post

All 3 Replies

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]};

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];

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.