java中把byte[]={49,50,51,52,53}转成字符串
发布网友
发布时间:2024-10-24 17:36
我来回答
共1个回答
热心网友
时间:2024-10-31 16:48
public class Test{
public static void main(String[] args){
byte[] arr ={49,50,51,52,53};
String str = "";
for(int i = 0; i < arr.length; i++){
if(i == arr.length-1){
str += arr[i];
}else{
str += arr[i]+",";
}
}
System.out.println(str);
}
}