forum

Home / DeveloperSection / Forums / Generate random numbers between two numbers

Generate random numbers between two numbers

Anonymous User217107-May-2013
Hi Guys!

public class TestSample {
    public static void main(String[] args) { 

        int a = Integer.parseInt(args[0]);
        int b = Integer.parseInt(args[1]);

        double ran = Math.random();
    }
}
I don't want to use Random r = new Random(); class. Is there any other way to generate random numbers. I am just struck with what logic could be applied to generate random numbers between two numbers.

Thanks in advance!

Updated on 07-May-2013
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By