Math.random(): Returns a double value greater than or equal to 0.0 and strictly less than 1.0.
How to apply it: Generate a random int from a to b inclusive: (int)(Math.random() * (b - a + 1)) + a.
Course: AP Computer Science A · Unit: Using Objects
Practice questions about Math.random() on AimFive — get rubric-based feedback showing exactly which points you earned.
AP and Advanced Placement are trademarks of College Board. AimFive is not affiliated with or endorsed by College Board.