Write a method that properly compares 2 Strings and returns true is they are equal, and false if they are different. If the method already exists as part of the Java library, please state its name, arguments and return type. method exists as part of the String class, string1.equals(String2), returns true if String1 is equal to String2, false otherwise
Public static boolean compareString(String1, int[] String2)
{
boolean equals = true;
if (String1.length != String2.length)
equals = false;
else
for(int i = 0; i < String1.length; i++)
if (String1[i] != String2[i])
equals = false;
}
returns equals.
find and correct the error of the following code segment:
{
public static void main(String[] args)
double [] [] twoDimArray = {{25,77,82,18,99,11},