|
楼主 |
发表于 2004-10-29 13:38:10
|
显示全部楼层
会吗?我做过,可以的,不过要做强制类型转换,不过无所谓。随手乱写了点代码测试了一下,运行正常。[code:1]public class Testing {
/**
*
*/
public Testing() {
super();
// TODO 自动生成构造函数存根
}
public static void main(String[] args) {
byte[] by = {12,127,0,22,24,56,29,95};
int in;
for (int i=0;i<by.length;i++){
in = (int)(by[i]);
System.out.print(in);
System.out.print(" , ");
}
}
}
[/code:1][code:1]public class Testing {
/**
*
*/
public Testing() {
super();
// TODO 自动生成构造函数存根
}
public static void main(String[] args) {
byte[] by = {12,127,0,22,24,56,29,95};
int in;
for (int i=0;i+1<by.length;i++){
in = by[i]*33+by[i+1]*11;
System.out.print(in);
System.out.print(" , ");
}
}
}
[/code:1] |
|