返回数组方法 return code 中的code 下面有波浪线怎么回事
private static int[] getBinary(String text)
{
StringBuffer num = new StringBuffer();
String s;
char ch;
for (int i = 0; i < text.length(); i++) {
// 把每个字符转换为二进制
s = Integer.toBinaryString(text.charAt(i));
// 转换的二进制代码如果少于八位把它转化为八位
for (int j = 8 - s.length(); j > 0; j--)
num.append(0);
num.append(s);
}
//此处的定义不能早也不能晚
int len = num.length();
int[] code = new int[len];
for (int i = 0; i < len; i++)
// Change each 0/1 char to int.
{
code[i] = Character.getNumericValue(num.charAt(i));
}
// int [] codecopy=code;
//return codecopy;
return code;
}