简体   繁体   English

代码中有错误,我不知道如何纠正

[英]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 我在arrayOfByte1.length中有一个错误,我不知道它是否结构正确

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

it gives error: 它给出了错误:
- Error:(1381, 33) error: not a statement - Error:(1381, 33) error: not a statement
- Error:(1734, 27) error: illegal start of expression - Error:(1734, 27) error: illegal start of expression

those two errors in that line of code of arrayOfByte1.length. 那行arrayOfByte1.length的代码中的这两个错误。

It is because arrayOfByte1.length; 这是因为arrayOfByte1.length; is not a statement but a variable . 不是陈述而是变量 So, you need to use variable to hold the value with: 因此,您需要使用变量来保存以下值:

int length = arrayOfByte1.length;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何更正此代码以使其通用? - How do I correct this code to make it generic? 如何更正 NumberFormatException 错误? - How do I correct a NumberFormatException error? 如何在看似正确的“inputSpec”中修复 OpenAPI 错误以生成代码? - How do I fix OpenAPI error in seemingly correct 'inputSpec' for code generation? 我怎么知道我的代码库是否有 java 8 方法 - how do I know if my code base has java 8 methods 我如何知道与服务器的连接是否正确? - How i can know if the conection to server is correct or not? 我正在为我的班级使用 java 在 JGrasp 中制作一个神奇的 8 球。 如何让我的代码运行? 我不知道我的错误是什么或如何解决它? - I am working on making a magic 8 ball in JGrasp using java for my class. how do I get my code to run? I do not know what my error is or how to fix it? nullpointerexception 错误我现在知道如何修复 - nullpointerexception error I do now know how to fix 如何在此代码中添加按钮? 我不知道怎么放 - How do I add buttons to this code? I do not know how or where to put it 在Java中,什么是悬空的元字符,如何纠正此错误? - In Java what is a dangling meta character and how do I correct this error? 我如何知道可以在GWT的客户端实现中使用哪些代码? - How do I know which code can be used in the client side implementation of GWT?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM