简体   繁体   中英

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.

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;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM