byte[] bytes = {72, 101, 108, 108, 111}; // "Hello" in ASCII
String str = new String(bytes);
System.out.println...= new String(bytes, 0, 5); // 只转换前5个字符
System.out.println(str); // 输出: Hello
String(byte[] bytes, Charset..._8);
System.out.println(str); // 输出: Hello
String(byte[] bytes, int offset, int length, String charsetName...= new String(bytes, 6, 5, "US-ASCII"); // 从第6个字符开始转换5个字符
System.out.println(str); // 输出: World
String...byte[] bytes = {72, 101, 108, 108, 111}; // "Hello" in ASCII
String str = new String(bytes, "UTF-8");