How to determine if numbers in an array list if divisible by the numbers in another array list?
<p>I am trying to determine if the numbers in an array list are divisiable by all of numbers in antoher arraylist. My code below outputs all of the numbers from the <code>listdiv</code> list that are disible by <strong>any</strong> divisors in the <code>listdivisor</code>. I would like to output the values that are divisible by all divisiors in the list not any of them. For example If I have listdiv = [1,2,3,,5,8] and  listdivisor= [2,4]. the expected output should be 8 , but this code outputs 2 and 8 .  </p>

<p>Thank you !your effort will be greatly appreciated!</p>

<pre><code>for (int i = 0; i &lt; listdiv.size(); i++) {
            for (int c = 0; c &lt; listdivisor.size(); c++) {
                if (listdiv.get(i) % listdivisor.get(c) == 0) {
                System.out.println("final results are :  " + listdiv.get(i));
                }
            }
        }
</code></pre>