Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- boolean areEquals = true;
- int[] a = {1,2,3,4,5};
- int[] b = {1,2,3,4,5};
- for(int i = 0; i < a.length; i++) {
- if(a[i] != b[i]) areEquals = false;
- }
- if (areEquals) System.out.println("Els arrays son iguals");
- else System.out.println("Els arrays no son iguals");
- System.out.print("Array A: ");
- for(int element : a) System.out.print(element + " ");
- System.out.print("\nArray B: ");
- for(int element : b) System.out.print(element + " ");
Advertisement
Add Comment
Please, Sign In to add comment