Determining common divisors of two numbers
There are few improvements you can do in your code:


First choose better variable names. I would name the Scanner type variable as scanner rather than x. Really, x, y, z are the worst variable name, which doesn't give any idea as to what they denote. 
Secondly, I won't force user to pass larger number first, and then smaller number. I would take the burden of finding that out myself.
There is no need of storing all the divisors of both the numbers in two different arrays. Suppose you have to find common divisor of 2 and 2132340. Will you store all the divisors of 2132340, or simply check that the common divisor cannot be greater than the divisor of 2, and use that fact?
Another fact is, all the divisors of num1 will be less than or equal to num1 / 2. Now, if num1 &lt; num2, then the common divisors all must be &lt; num1 / 2. So, iterate the loop till min / 2.
Of course, you can move the code that finds the common divisor in a different method, and store them in a List&lt;Integer&gt;.
Lastly, it might be possible that the smaller number itself is a divisor of larger number. So, you need to store that too.


Here's the modified code which looks a bit cleaner:

public static void main (String args[]){
    Scanner scanner = new Scanner(System.in);

    System.out.print("Enter the 1st number :  ");
    int num1 = scanner.nextInt();
    System.out.print("Enter the 2nd number : ");
    int num2 = scanner.nextInt();

    List&lt;Integer&gt; commonDivisor = getCommonDivisor(num1, num2);
    System.out.println(commonDivisor);
}

public static List&lt;Integer&gt; getCommonDivisor(int num1, int num2) {

    List&lt;Integer&gt; list = new ArrayList&lt;Integer&gt;();

    int min = minimum(num1, num2);

    for(int i = 1; i &lt;= min / 2; i++) { 
        if (num1 % i == 0 &amp;&amp; num2 % i == 0) {
            list.add(i);
        }
    }

    if (num1 % min == 0 &amp;&amp; num2 % min == 0) {
        list.add(min);
    }

    return list;
}

public static int minimum(int num1, int num2) {
    return num1 &lt;= num2 ? num1 : num2;
}