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

I get this error.

Type mismatch: cannot convert from int to int[]

Recommended Answers

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 developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.