Open In App

Java | Arrays | Question 8

Last Updated : 28 Jun, 2021
Like Article
Like
Save
Share
Report




class Test
{
    public static void main (String[] args) 
    {
        int arr1[] = {1, 2, 3};
        int arr2[] = {1, 2, 3};
        if (arr1.equals(arr2))
            System.out.println("Same");
        else
            System.out.println("Not same");
    }
}


(A) Same
(B) Not same


Answer: (B)

Explanation: arr1.equals(arr2) is same as (arr1 == arr2) 

Quiz of this Question


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads