+ 1

How to allow user to input only number and character (A-F) in java? And how to match number to characters in java?

It is number conversion,Hexadecimal to binary,octal, and decimal. How to fix it in java?

1st Jan 2020, 7:03 AM
Neath
Neath - avatar
1 Answer
0
you can try extracting every character in the string which you are inputting and then compare them with ASCII codes. ASCII codes are numbers which correspond to numbers letters and special characters. A-Z is 65 to 90 a-z is 97-122 0-9 is 48-57
27th Jul 2020, 12:28 PM
Praharsh Gurudatta
Praharsh Gurudatta - avatar