Heyo Java Developers!
Im not a great java developer and my knowledge of the language is very limited.
I have a question.
lets say I have a method to generate a random number, randNum(int min, int max);,
and I want to generate a random number of random numbers, and store each number to a different variable.
For instance,
Is this possible? Whats the best way to do this?
Im not a great java developer and my knowledge of the language is very limited.
I have a question.
lets say I have a method to generate a random number, randNum(int min, int max);,
and I want to generate a random number of random numbers, and store each number to a different variable.
For instance,
Code:
int x = randNum(0, 4);
for(int y = 0; y < x; y++){
randNum(0,9);
//If int x = 0 it will not run,
// If int x = 1 it will generate a random number, and store it to variable 'num1'
//If int x = 2 it will generate a random number and store it to variable 'num1', then generate another random number and store it to variable 'num2', and so on until y > x
}
Is this possible? Whats the best way to do this?
