java什么字符等于00000000字节?
我需要在字符串生成器中追加00000000字节的字符。 我需要把它放到字符串数组中,以后再读一遍。 例如:
StringBuilder sBfNumRow = new StringBuilder();
sBfNumRow.append(""); //add char that 00000000 in byte
stObj [c] = sBfNumRow.toString(); // put into String array
stObj [c] .getBytes // read it again later.
有人能帮我做这个吗
# 1 楼答案
一个char和int可以相互铸造,所以使用该技术
举例说明
或者直接使用0而不使用“0”
在你的代码中应该是这样的
编辑:新答案提供了改进我答案的想法
# 2 楼答案
那就是
如果你想特别使用char类型。这个
将使用
StringBuilder.append(int)