int[] n = {20,33,40}; int i = n[ (int) Math.round(Math.random()) * (n.length-1) ]; System.out.println(i);