Convert byte to String by Creating a byte array and passing it to the String constructor in Java
Description
The following code shows how to convert byte to String by Creating a byte array and passing it to the String constructor.
Example
// w w w . j a v a 2 s .c om
public class Main {
public static void main(String[] args) {
byte b = 65;
System.out.println(new String(new byte[] {b}));
}
}
The code above generates the following result.
Home »
Java Tutorial »
Java Data Type »
Java Tutorial »
Java Data Type »