Information Technology Questions and Answers Community

Generating random numbers in Java

What is the way for generating random numbers in Java?

Java        
Your Answer: 

1 Answers

The function Math.random() can do this where the range needs to be fixed. Also, a Random class in package java.util can do this.

Answered On 04 Apr at 10:32
Edit Account
LOGIN INFORMATION
Change Settings
Email Notifications Notifications will be sent to abcd@gmail.com
Select option for your email notifications:
Mature / News Filter We'll send on email when new jobs are posted
Option 2 for email notification We'll send on email when new jobs are posted