Sebast U
Sebast U

Reputation: 11

There is an error in the code and I do not know how to correct it

I have an error in the arrayOfByte1.length and I do not know if it is well structured

byte[] arrayOfByte1 = paramAnonymousMessage.getData().getByteArray("DeviceData");
                arrayOfByte1.length;

it gives error:
- Error:(1381, 33) error: not a statement
- Error:(1734, 27) error: illegal start of expression

those two errors in that line of code of arrayOfByte1.length.

Upvotes: 0

Views: 46

Answers (1)

ישו אוהב אותך
ישו אוהב אותך

Reputation: 29783

It is because arrayOfByte1.length; is not a statement but a variable. So, you need to use variable to hold the value with:

int length = arrayOfByte1.length;

Upvotes: 1

Related Questions