Check out example codes for "random numeros negativos java". It will help you in understanding the concepts better.

Code Example 1

long myRandomLong = (long)(Math.random() * 500 * (Math.random() > 0.5 ? 1 : -1));

Learn ReactJs, React Native from akashmittal.com