generate random numbers until i get specific number java code example Example: random numbers java int random = (int) (Math.random()*(max-min+1)+min);