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
Home » Java Tutorials » Servlet Tutorials
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
1
Tutorials Categories
Make a good first impression during an office interview
- important to be punctual and arrive a few minutes early.
- Confirm directions or drive to the location on the previous day to ensure you know where you are going.
- Put your best foot forward. Dress appropriately for the position you are seeking.