K
kloro
bug in j2me Random implementation?
From:
tom arnall <[email protected]>
To:
Date:
Sunday 05:17:49 pm
the following:
public class Test1 extends MIDlet implements CommandListener {
public void startApp() {
Random rand = new Random();
System.out.println(rand.nextInt(5));
}
.
.
.
from the J2me compiler gets:
home/kloro/cell/WTK2.2/apps/Test1/src/Test1.java:11: nextInt()
in
java.util.Random cannot be applied to (int)
System.out.println(rand.nextInt(5));
yet the doc' for Random states in the methods section:
nextInt(int n) - Returns a pseudorandom, uniformly distributed
int value
between 0 (inclusive) and the specified value (exclusive),
drawn from this
random number generator's sequence.
same type of result for long, double, short.
From:
tom arnall <[email protected]>
To:
Date:
Sunday 05:17:49 pm
the following:
public class Test1 extends MIDlet implements CommandListener {
public void startApp() {
Random rand = new Random();
System.out.println(rand.nextInt(5));
}
.
.
.
from the J2me compiler gets:
home/kloro/cell/WTK2.2/apps/Test1/src/Test1.java:11: nextInt()
in
java.util.Random cannot be applied to (int)
System.out.println(rand.nextInt(5));
yet the doc' for Random states in the methods section:
nextInt(int n) - Returns a pseudorandom, uniformly distributed
int value
between 0 (inclusive) and the specified value (exclusive),
drawn from this
random number generator's sequence.
same type of result for long, double, short.