JAVA中String转换数据类型原来这么简单

String类型的数据转为byte数组:

String str=""qwertyuiop;

byte [] bytes=str.getBytes();

byte字节类型转为String类型数据:

String str=""qwertyuiop;

byte [] bytes=str.getBytes();

String st=new String(bytes);

猜你喜欢

转载自blog.csdn.net/hjmlyj/article/details/83587564