I have a scenario in a java web app, where a random hexadecimal value has to be generated. This value should be within a range of values specified by me. (The range of values can be hexadecimal or integer values).
What is the most efficient way to do this> Do I have to generate a random decimal number, and then convert it to hexadecimal? Or can a value be directly generated?
Yes, you just generate a decimal value in your range. Something such as:
Hex and decimal numbers are handled the same way in Java (as integers), and are just displayed or inputted differently. (More info on that.)