怎样在一个方法中
用 random 生成一个在50到1000之间,且是50倍数的数
返回一个int
我这样写是不是不对呀?怎么修改呢?
public static int getBalloonValue() {
Random random = new Random();
int balloonValue = random.nextInt(1);
if (balloonValue % 50 == 0 || balloonValue > 50 || balloonValue < 1000) {
}
return balloonValue;
}