Taken from this site: https://www.journaldev.com/770/string-byte-array-java
package com.journaldev.util;
public class ByteArrayToString {
public static void main(String[] args) {
byte[] byteArray = { 'P', 'A', 'N', 'K', 'A', 'J' };
byte[] byteArray1 = { 80, 65, 78, 75, 65, 74 };
String str = new String(byteArray);
String str1 = new String(byteArray1);
System.out.println(str);
System.out.println(str1);
}
}
Why is the output:
PANKAJ
PANKAJ
I can't see how it isn't:
PANKAJ
806578756574
80is not the same thing as"80".'P', etc.