问题描述
publicclassByteArrayDemo{publicstaticStringbyteToString(byte[]password){Stringstrl=newString(password);returnstrl;}publicstaticvoidmain(String[]args){byte[]xx={1,2,2};System.out.println("用戶密碼是:"+byteToString(xx));}}用这种方法转String的话输出是个乱码在byte[]转String怎么转,当当用getbyte转的也是乱码
时间: 2025-01-21 06:37:35