How to generate Random Numbers in J2ME application
|
|
One of the popular question asked in this blog is ways to generate random numbers in J2ME application.
As most people probably realized, the JavaME CLDC does not include the Math.Random class to generate random numbers. However one can generate a series of random numbers in JavaME/J2ME application by using the included java.util.Random class.

Here's a sample usage
JAVA:
The sample code above will produce a random floating-point number between 0..100 (exclusive)
Here's the source code for the full Random Number Demo application : RandomDemo.java,
Tags: cldc, j2me, Java, javame, midp, mobile, programming, sun, tutorial|
|






tag this
November 29th, 2007 at 4:39 pm
mbnmcvjkdj