gpt4 book ai didi

java - testeInt.java :100: error: ']' expected

转载 作者:行者123 更新时间:2023-12-01 10:14:42 24 4
gpt4 key购买 nike

public static String byteToHexa(final byte bits){

final int l = bits & 0xF;
final int h = bits >>> 4 & 0xF;

return String.valueOf(HEXAS[h]) + String.valueOf(HEXAS[l]);
}


public static String bytesToHexas(final byte[] bytes){

final StringBuffer buffer = new StringBuffer();
final int length = bytes.length;
int i;
for (i = 0; i < length; i++) {
buffer.append(byteToHexa(byte[i]));
}
return buffer.toString();
}

testeInt.java:100: 错误:预期为“]” buffer.append(byteToHexa(byte[i]));

testeInt.java:100: 错误:预期为“)” buffer.append(byteToHexa(byte[i]));

testeInt.java:100: 错误: ';'预期的 buffer.append(byteToHexa(byte[i]));

最佳答案

这只不过是一个打印错误:

byte[i] 应该是 bytes[i]

关于java - testeInt.java :100: error: ']' expected,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35970547/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com