# Now limit the range of the randomNumber variable from 0 to 9. Use the version of nextInt() that takes a parameter specif

Now limit the range of the randomNumber variable from 0 to 9. Use the version of nextInt() that takes a parameter specifying how many numbers to choose from.

Random randomGenerator = new Random(); int randomNumber = randomGenerator.nextInt(3); fact = randomNumber + "" ;

why this test don't accept my option because he said use a number 0 to 9 i put 3 example a said are a error.

RandomTest.java
```Random randomGenerator = new Random();
int randomNumber = randomGenerator.nextInt(3);
```

`nextInt(3)` will only give you a number from 0 to 2, not 0 to 9. You want to use a number that will let nextInt give you a result of 0 to 9.

yeah man i put the number (9) and said a error epxlaim much better please because a i'm losing the time here.

Random randomGenerator = new Random(); int randomNumber = randomGenerator.nextInt(9); here put the limite 0 to 9

Forgot the bound on nextInt is exclusive, i.e., the value from nextInt will be from 0 to bound-1 but won't include bound. Edited my answer to reflect that.

Random randomGenerator = new Random(); int randomNumber = randomGenerator.nextInt(0);

thanks i put 10 a ready

but explaim me this Create a String variable named intAsString. Convert the randomNumber integer to a String value and store it in the intAsString variable. Hint: Add them together like in the video!

I have a question: Why this one work: 1. Random randomGenerator = new Random(); int randomNumber = randomGenerator.nextInt(10); but this one doesn't work: 2. Random randomGenerator = new Random(); int randomNumber = randomGenerator.nextInt(n:10); I thought I saw the lecturer did the method 2 in the video. But when I put n:10, it did not work so I changed to method 1: (10) and it worked. many thanks for the explanation!

STAFF

I don't want to give you the answer outright, but let's try this: I'll give you all the pieces you need for that final line, and you'll just need to figure out how to configure them in the right way to meet that last requirement.

```String
intAsString
=
randomNumber
+
""
;
```

Remember that you'll start by declaring a variable named `intAsString`. You need the type to be `String`. Then you set it equal to something. In this case you want to set it to the random number stored in a variable. But since that number is an `int` type, you need to convert it to a `String`, which you can do using the same shortcut like we did in the previous video.