Complete the following Java code such that are TwoArraysSame() method receives two arrays of String data type and then returns true if the two arrays contain the exactly same contents. Otherwise, it returns false. (Hint: You should first check if two arrays contain the same number of elements.)
public boolean areTwoArraysSame(String[] array1, String[] array2)
{
boolean arraysEqual = true;
int i = 0;
int whereFalse = 0;
if (array1.length != array2.length){
arraysEqual = false;}
while (arraysEqual && i < array1.length)
{
if (array1[i] != array2[i])
{
arraysEqual = false;
whereFalse = i;
}
i++;
}
}