Pages

Tuesday, 29 September 2015

Generating a Random Number (Integer) In Java

Hi all,


Today at work I just wanted to generate a Random Integer number. It was pretty easy but sometimes it may get little bit tricky. For this you need to import  to your class.

Suppose you want to generate Random numbers between a MAX and a MIN value. 

If you want to generate a number between 1 and 10, It would be like below;

No comments:

Post a Comment