Android Build a Simple Android App Basic Android Programming Generating a Random Number

Random number showing codes not numbers

at the last part testing if the random number works or not. my shows:(java.util.Random@fdfea46)...ect instead 1 2 3 0.

Help !


It sounds like your randomGenerator object is being printed. Instead, you want to use the method randomGenerator.nextInt( int parameter ), which will return an int less than the parameter.

1 Answer

I think you used fact = randomGenerator + ""; instead of fact = randomNumber + ""; .