I have implemented: else if (nr1 == nr2 && nr1 == nr3 && nr2 == nr3) System.out.println(nr1 + " " + nr2 + " " + nr3); So if nr1, nr2 and nr3 will be the same it should show: nr1 + nr2 + nr3 but somehow it does not work. Can you explain me why and how to fix it? Thanks