There’s no such thing as infinity in programming, but you can use Integer.MAX_VALUE which is basically the same.
You can read about it here: https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html
4
solved generate random number larger than given number until infinity in java