Browse Today's favorites or All time favorites.
Please Sign In or Register to share and submit your questions.
Java Queries
Complete java interview questions library
April
2008
How do I generate a random number between 0 and some integer n
First you would need to create an instance of Random class:
Random random = new Random();
Then, you can get your random number by calling:
int pick = random.nextInt(maxvalue);
This would return a value from 0 (inclusive) to maxvalue (excl
Tutorials Categories
Learn all you can
Learn all you can about the company or organization; learn as much as you can so that your questions are sophisticated and knowledgeable during the interview. Employers expect you to arrive knowing background information about the organization