Write a Java Program to check for the equality of two multidimensional string arrays in java?

 

package testjava.javatest;

import java.util.Arrays;

public class EqualMultiStringArrays
{
	public static void main(String args[])
	{
		String[][] firstString = 
        {
            {"is", "this", "programs", "buzz"},
            {"this", "is", "programs", "buzz"}
        };										
									
        String[][] secondString = 
        {
            {"is", "this", "programs", "buzz"},
            {"this", "is", "programs", "buzz"}
        };
        
        String[][] thirdString =
        { 
            {"yes", "its", "programs", "buzz"},
            {"this", "is", "programs", "buzz"}
        };

        System.out.println(Arrays.deepEquals(firstString, secondString));        //Output : true
        System.out.println(Arrays.deepEquals(firstString, thirdString));      //Output : false
	}   
}