0
Why and How answer is not same?
public class Program { public static void main(String[] args) { int arr1[]={1,2,3}; int arr2[]={1,2,3}; if(arr1==arr2) System.out.println("same"); else System.out.println("not same"); Answer :not same
3 Answers
+ 4
Why do you think it should be same?
Just because it has similar elements?
Consider this, there is family1 with three members and then there is family2 with another 3 members.
Though they are 2 families having same number of people but aren't they actually different? Don't they have different addresses?
So apply the same to arrays is java which are nothing but objects which are obviously created in different memory locations.
+ 3
Arr1&arr2 Different Refrences Variable point to Two different object
+ 2
Please use other tags than a!
you have a java question so tag java would be a good idea.