при сравнении переменной к null. почему?
package com.javarush.task.task04.task0417;

/*
Существует ли пара?
*/

import java.io.*;
import java.util.*;

public class Solution {
    public static void main(String[] args) throws Exception {
        Scanner s = new Scanner(System.in);
        int a = s.nextInt(), b = s.nextInt(), c = s.nextInt();
        int x, y, z;
        if(a==b){
            x = a;
            y = b;
        }
        if(a==c){
            x = a;
            z = c;
        }
        if(b==c){
            y = b;
            z = c;
        }

        if(x==y && z==null) System.out.println(x + " " + y);
        if(y==z && a==null) System.out.println(y + " " + z);
        if(x==z && y==null) System.out.println(x + " " + z);
        if(x==null && y==null && z==null) break;
    }
}