+ 2

How to generate unique random number in java using awt?

11th Sep 2020, 4:31 AM
Karthick Baskar
Karthick Baskar - avatar
6 ответов
+ 1
Create a Button and TextField. Add ActionListener to Button, generate a number using Random class and set it to TextField.
11th Sep 2020, 5:25 AM
Aleksandrs
Aleksandrs - avatar
+ 1
Aleksandrs Kalinins . Thanks.. but my question is how to generate 'unique' random number.. (i.e.) to avoid duplicates
11th Sep 2020, 5:26 AM
Karthick Baskar
Karthick Baskar - avatar
+ 1
okay , Thank you 😊 Aleksandrs Kalinins
11th Sep 2020, 7:16 AM
Karthick Baskar
Karthick Baskar - avatar
+ 1
Martin Taylor Thank you 😊
11th Sep 2020, 11:20 AM
Karthick Baskar
Karthick Baskar - avatar
+ 1
Karthick Baskar The problem with your question is the use of the phrase "unique random number" which would imply using numeric values. However, it sounds like you really want a "unique random value" which includes alphanumeric characters.
11th Sep 2020, 3:00 PM
David Carroll
David Carroll - avatar