Q:

Java - Insert values from Array of type Float, into a New Array of type float by index

I have 2 Arrays and an ArrayList
float[] a = new float [1000]; // contains 1000 float values

float[] b = new float [1000]; // contains 1000 float values

ArrayList<Float> c = new ArrayList<Float>(); // contains unique list of float values from array a

I wish to perform the following
for (int i=0; i<a.length; i++) {
      b[c.indexOf(c.get(i)]++; 
}

Essentially, i am wanting to go through the length of a, find where the first value from C is found, then insert that into a new array b.
However i am returned with an index out of bound error, or incompatible type error expected float() found int().
I have also experiment with wrappers when defining float, due to primitive types. 
Any help would be great.

A:

Here both the arrays a and b are of type float.
by the statement 
b[c.indexOf(c.get(i)]++;  you are applying an increment operator which is for int datatypes not float.
So to do what you want you have to typecast the float to integer than you can apply this increment operator.

