Question: In java people can put randomized number:

```
import java.util.Random;

```

I'm developing a game and its essential for the randomizers in my game. But it changes numbers to fast for me and I really liked a time for it to change to a new randomized number. How do I do that? I tried to search on google but gave me nothing.

Answer: 
I think perhaps you've misunderstood how it works. When you call, for example, `random.nextInt(10);` it returns a different number every time you call it. It is not 'always changing', it generates a sequence of numbers, and you are in control of when it does this. It will not generate new numbers until you ask it to.

You can assign it to a variable if you want to save it between calls to `nextInt()`, etc.
You can use `Timer` and `TimerTask` for generating random numbers at regular intervals like this:

```
public class MyRandomNumberGenerator extends TimerTask{
int ramdomNumber =0;
Random r = new Random();
@Override
    public void run() {
        // TODO Auto-generated method stub
        randomNumber = r.nextInt(10);
        //Returns a pseudorandom, uniformly distributed int value between 0 (inclusive) and the specified value (exclusive) here it is 10,

    }
public int getRandomNumber(){
    return randomNumber;
} 

}

```

Now in your main class where you want to use random numbers

use this code

```
MyRandomNumberGenerator rng = new MyRandomNUmberGenerator();
Timer t = new Timer();
t.schedule(rng,System.getCurrentTimeMillis,10000);
int r = rng.getRandomNumber();

```

Here `System.getCurrentTimeMillis` means start the timer from now and `10000` means that every `10000` millisecond a new Random Number will be created and stored in the instance variable and then you can access that random number using the `getRandomNumber` method of `MyRandomNumberGenerator` class.