Related Articles

Related Articles

Java | Arrays | Question 8
  • Difficulty Level : Basic
  • Last Updated : 17 Jan, 2014
filter_none

edit
close

play_arrow

link
brightness_4
code

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");
    }
}

chevron_right


(A) Same
(B) Not same


Answer: (B)

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

Quiz of this Question

My Personal Notes arrow_drop_up
Recommended Articles
Page :