I'm still new to Java. I'm having trouble while retrieving the RGB pixel values from my method, compareHexaRGB which in this method I could get the difference pixel values based on comparison of 2 similar images. I tried the printString2DArray method but it doesn't work. It stated either incompatible types: String[][] cannot be converted to String[] or produce errors such as [[Ljava.lang.String;@6d09a8df

After I get the values, I would like to combine it to one Hex value then convert it to ASCII characters. I couldn't proceed to this process as the retrieve value couldn't work.

Here is the code for compareHexaRGB() method:

Java Code:
    public class compareHexaRGB
    {
     private static int w;
     private static int h;
     private static BufferedImage img;
     private static BufferedImage img2;
     private static String[][] check_hex2;
     private static String[][] check_hex4;
     private static String[][] message;

     public static void compareHexaRGB(BufferedImage image, BufferedImage image2, int width, int height) throws IOException
    {
    w = width;
    h = height;
    img = image;
    img2 = image2;

    }

    public void check() throws IOException
    {
        getPixelRGB1 pixel = new getPixelRGB1();
        getPixelData1 newPD = new getPixelData1();

        int[] rgb;
        int count = 0;

        int[][] pixelData = new int[w * h][3];
        check_hex2 = new String[w][h];
        check_hex4 = new String[w][h];

        for(int i = 0; i < w; i++) 
        {
            for(int j = 0; j < h; j++)
            {
                rgb = newPD.getPixelData(img, i, j);

                for(int k = 0; k < rgb.length; k++)
                {
                    pixelData[count][k] = rgb[k];
                }

                    if(pixel.display_imgHex2()[i][j].equals(pixel.display_img2Hex2()[i][j]))
                    {
                        System.out.println("\nPixel values at position 2 are the same." + "\n" + pixel.display_imgHex2()[i][j] + "  " + pixel.display_img2Hex2()[i][j]);
                    }
                    if(pixel.display_imgHex4()[i][j].equals(pixel.display_img2Hex4()[i][j]))
                    {
                        System.out.println("\nPixel values at position 4 are the same." + "\n" + pixel.display_imgHex4()[i][j] + "  " + pixel.display_img2Hex4()[i][j]);
                    }
                    if(!pixel.display_imgHex2()[i][j].equals(pixel.display_img2Hex2()[i][j]))
                    {
                        System.out.println("\nPixel values at position 2 are not the same." + "\n" + pixel.display_imgHex2()[i][j] + "  " + pixel.display_img2Hex2()[i][j]);
                        check_hex2[i][j] = pixel.display_img2Hex2()[i][j];
                        System.out.println("\nOutput Hex 2: " + check_hex2[i][j]);
                    }
                    if(!pixel.display_imgHex4()[i][j].equals(pixel.display_img2Hex4()[i][j]))
                    {
                        System.out.println("\nPixel values at position 4 are not the same." + "\n" + pixel.display_imgHex4()[i][j] + "  " + pixel.display_img2Hex4()[i][j]);
                        check_hex4[i][j] = pixel.display_img2Hex4()[i][j];
                        System.out.println("\nOutput Hex 4: " + check_hex4[i][j]);
                    }
                    if(!pixel.display_imgHex2()[i][j].equals(pixel.display_img2Hex2()[i][j]) || (!pixel.display_imgHex4()[i][j].equals(pixel.display_img2Hex4()[i][j])))
                    {
                        System.out.println("\nOne of the pixel values at position 2 and 4 are not the same." + "\n" + pixel.display_imgHex2()[i][j] + "  " + pixel.display_img2Hex2()[i][j] + "\n" + pixel.display_imgHex4()[i][j] + "  " + pixel.display_img2Hex4()[i][j]);

                        if(!pixel.display_imgHex2()[i][j].equals(pixel.display_img2Hex2()[i][j]) || (pixel.display_imgHex2()[i][j].equals(pixel.display_img2Hex2()[i][j])))
                        {
                            check_hex2[i][j] = pixel.display_img2Hex2()[i][j];
                            System.out.println("\nOutput Hex 2: " + check_hex2[i][j]);
                        }

                        if(!pixel.display_imgHex4()[i][j].equals(pixel.display_img2Hex4()[i][j]) || (pixel.display_imgHex4()[i][j].equals(pixel.display_img2Hex4()[i][j])))
                        {
                            check_hex4[i][j] = pixel.display_img2Hex4()[i][j];
                            System.out.println("\nOutput Hex 4: " + check_hex4[i][j]);
                        }

                    }
                count++;
                System.out.println("\nOutput Count: " + count);
            }

        }

    }

    public String[][] getCheck_hex2()
    {
        return check_hex2;
    }

    public String[][] getCheck_hex4()
    {
        return check_hex4;
    }
    }
Code for extractMessage() method:

Java Code:
    public class extractMessage
    {
    private static String character;
    private static String[][] char1;
    private static String[][] char2;
    private static int w;
    private static int h;
    
    private static void printString2DArray(String[][] in) 
    {
        for (int i = 0; i < in.length; i++) 
        {
            if (i != 0)
            {
                System.out.print(", ");
            }
            System.out.print(java.util.Arrays.toString(in[i]));
        }
    }
    
    public static void charExtract()
    {
    compareHexaRGB hexRGB = new compareHexaRGB();
    
    char1 = new String[][]
    {
    new String[] { hexRGB.getCheck_hex2() } //error stated incompatible types
    };
    
    System.out.println("Char 1: ");
    printString2DArray(hexRGB.getCheck_hex2());
    
    }
    
    public String convertHexToString()
    {
    StringBuilder sb = new StringBuilder();
    StringBuilder temp = new StringBuilder();
    
    extractMessage extract = new extractMessage();
    extract.charExtract();
    
    for(int i = 0; i < extract.length(); i+=2) //error stated couldn't find symbol extract
    {
    String output = extract.substring(i, (i + 2));
    int decimal = Integer.parseInt(output, 16);
    sb.append((char)decimal);
    
    temp.append(decimal);
    }
    return sb.toString();
    }
    }
Any help I would appreciate!