Hello Chiru,
Did you look at another version of nextInt() method?
The API
doc says about this method:
Returns a pseudorandom, uniformly distributed int value between 0 (inclusive) and the specified value (exclusive), drawn from this random number generator's sequence.
[ June 02, 2008: Message edited by: Vishal Pandya ]