如何将byte转换byte
答案:1 悬赏:0
解决时间 2021-01-07 19:27
- 提问者网友:雾里闻花香
- 2021-01-06 20:39
如何将byte转换byte
最佳答案
- 二级知识专家网友:廢物販賣機
- 2021-01-06 21:37
public class ByteTest {
public static void main(String[] args) {
String str = "Hello world!";
// string转byte
byte[] bs = str.getBytes();
System.out.println(Arrays.toString(bs));
// byte转string
String str2 = new String(bs);
System.out.println(str2);
}
public static void main(String[] args) {
String str = "Hello world!";
// string转byte
byte[] bs = str.getBytes();
System.out.println(Arrays.toString(bs));
// byte转string
String str2 = new String(bs);
System.out.println(str2);
}
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯