int upperBound = 999; int lowerBound = 100; int number = lowerBound + (int)(Math.random() * ((upperBound - lowerBound) + 1));