0 votes
146 views
asked in JAVA by
HI

  How to generate only positive numbers in JAVA?

1 Answer

0 votes
answered by
int answer = Math.abs(r.nextInt()%101);

Categories

...