Array.15.

PHOTO EMBED

Sat Dec 10 2022 17:40:47 GMT+0000 (Coordinated Universal Time)

Saved by @KutasKozla #java

import java.util.Arrays;
public class PJJJeden {

    public static void main(String[] args) {
        int[] tabA = {25, 14, 56, 15, 36, 36, 77, 18, 29, 49};
        int[] tabB = {25, 14, 56, 17, 38, 36, 97, 18, 69, 99};
        CheckVal(tabA, tabB);
            }

    public static boolean CheckVal(int tabA[], int tabB[]) {
        for (int i = 0; i < tabA.length; i++) {
            for (int j = 0; j < tabB.length; j++) {
                if (tabA[i] == tabB[j])
                    System.out.println(tabA[i]);
            }

        }
        return false;
    }
}
content_copyCOPY

Write a Java program to find the common elements between two arrays of integers.

https://www.w3resource.com/java-exercises/array/java-array-exercise-15.php