How do you use random for a limit of numbers in JAVA
in this case
I'll say I wanna make random digits within 45 to 52
explain to me what I can do!
thnx anyway
10 Replies
⌛
This post has been reserved for your question.
Hey @OMIDD! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
So basically you want to get a random number between x nad y?
whats the purpose of the visual studio code image ?
+
thats question is a google question
u can just type exactly that, add java at the end and u will get a faster respond
yes
nothing
can you help me ?
+ If you are using Java 8 or later you can use
ThreadLocalRandom.current().nextInt(min, max + 1);
where min in your case would be 45 and max - 52hmm
thnx
If your question is answered you can close this post
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.