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
No description
10 Replies
JavaBot
JavaBot11mo ago
This post has been reserved for your question.
Hey @OMIDD! Please use /close or the Close 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.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
Defective
Defective11mo ago
So basically you want to get a random number between x nad y?
MoonSouhayl
MoonSouhayl11mo ago
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
OMIDD
OMIDDOP11mo ago
yes nothing can you help me ?
MoonSouhayl
MoonSouhayl11mo ago
No description
No description
Defective
Defective11mo ago
+ 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 - 52
OMIDD
OMIDDOP11mo ago
hmm thnx
Defective
Defective11mo ago
If your question is answered you can close this post
Unknown User
Unknown User11mo ago
Message Not Public
Sign In & Join Server To View
JavaBot
JavaBot11mo ago
💤 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.
Want results from more Discord servers?
Add your server