Здравейте, имам проблем с една задача:
Write a program that reads two int
arrays of size N
from the console and compares them element by element. Print Equal
if the two arrays are the same and Not equal
if they are not
Първото ми го изкарва правилно, второто не. Ако е възможно дали ще може да се даде решение?
Ето ми го кода
Scanner scanner = new Scanner(System.in);
int n = Integer.parseInt(scanner.nextLine());
int[] arr1 = new int[] {};
int[] arr2 = new int[] {};
if(Arrays.equals(arr1, arr2)) {
System.out.println("Equal");
}else {
System.out.println("Not Equal");
}
}
}