Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in Java only
Search
Advanced Search
Forums
BYTES
Product Launch
Updates
Developer Toolkit
Member List
Calendar
Today's Posts
Home
Forum
Topic
Java
random
random
Collapse
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
angah
New Member
Join Date:
Sep 2007
Posts:
1
#1
random
Sep 18 '07, 03:21 AM
how to generate random number using math.
Ganon11
Recognized Expert
Specialist
Join Date:
Oct 2006
Posts:
3651
#2
Sep 18 '07, 04:15 AM
Using the Random.java class. Google it and have a look at the first hit.
Comment
Post
Cancel
sateesht
New Member
Join Date:
Apr 2007
Posts:
41
#3
Sep 18 '07, 06:25 AM
Hi,
You can use Math.random() method to generate double numbers randomly, if u want to generate the random positive Integers use the nextInt() method of Random class as below.
Random r= new Random();
Math.abs(r.next Int());
Cheers,
Sateesh.
Comment
Post
Cancel
Previous
template
Next
Working...
OK
OK
Cancel
👍
👎
☕
Comment