//arrays.toString 返回指定数组内容的字符串表示形式。
public static void main(String[] args) throws IOException {
//默认GBK编码
/* String string="中国";
byte[] bytes = string.getBytes();
System.out.println(Arrays.toString(bytes));*/
String string="中国";
byte[] bytes = string.getBytes("utf-8");
System.out.println(Arrays.toString(bytes));
String string2 = new String(bytes,"utf-8");
System.out.println(string2);
}
}