Android Build a Simple Android App with Java Basic Android Programming Using the Random Class

how to convert a random number4

how to add int as string variable
Random randomGenerator= new Random();
int randomNumber=randomGenerator.nextInt(10);

1 Answer

Raffael Dettling
Raffael Dettling
31,046 Points

You named the new variable wrong and forgot to give it the type string



String intAsString = randomNumber + "";