Bill Tudor Bill Tudor - 1 year ago 52
Java Question

Store a function that returns an array into a two dimensional array

I'm trying to store a byte buffer into a two dimensional array.

byte[][] input = new byte[128][];
int index = 3;

ByteBuffer b = new ByteBuffer.allocate(128);


input[index][] = b.get();

I get an illegal start of expression error at the second [ ].


Your syntax is wrong, it should be input[index] = b.get();.