Java Data Type How to - Convert byte to String: Using the static toString method of the Byte class








Question

We would like to know how to convert byte to String: Using the static toString method of the Byte class.

Answer


public class Main {
    public static void main(String[] args) {
        byte b = 65;
        
        System.out.println(Byte.toString(b));

    }
}

The code above generates the following result.