Output of following Java program?
import java.util.Arrays;
class Test
{ public static void main (String[] args)
{
int arr1[] = { 1 , 2 , 3 };
int arr2[] = { 1 , 2 , 3 };
if (Arrays.equals(arr1, arr2))
System.out.println( "Same" );
else
System.out.println( "Not same" );
}
} |
(A) Same
(B) Not Same
Answer: (A)
Explanation: See https://www.geeksforgeeks.org/compare-two-arrays-java/amp/
Quiz of this Question