📜  Java |数组|问题7

📅  最后修改于: 2021-06-28 17:47:55             🧑  作者: Mango

以下Java程序的输出?

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)一样
(B)不一样答案: (A)
说明:参见https://www.geeksforgeeks.org/compare-two-arrays-java/
这个问题的测验