byte[] by = "java你好".getBytes();//占两个字节
System.out.println("数组的长度:"+by.length);//结果为8
String str = "java你好";
System.out.println("字符串的长度:"+str.length());//结果为6
时间: 2024-10-14 07:37:56
byte[] by = "java你好".getBytes();//占两个字节
System.out.println("数组的长度:"+by.length);//结果为8
String str = "java你好";
System.out.println("字符串的长度:"+str.length());//结果为6