Printing a Character Array in Binary and Hexadecimal Representation

public class JavaArray
{
    char sampleArray[] = {'A','B','C','D','E','\0','\0'};

    public void printArrayBinary(char array[])
    {
       int i;
       
       for(i=0; i < array.length; i++)
       {
          System.out.println(array[i] + "  " + 
                      Integer.toBinaryString((byte)array[i]) + "  " +
                      Integer.toHexString((byte)array[i]));
       }
     }

     public static void main(String args[])
     {
        JavaArray test = new JavaArray();
    
        test.printArrayBinary(test.sampleArray);
     }
}