lundi 17 février 2020

How do I convert a random number in to a character

I have tried to convert a random number into a character.
If I type a number into a variable it works, but if I do this int number = (int)(Math.random()*10); and then to assign it to a char and convert it char c = (char)number; when I print it, it shows nothing without errors like an invisible character.
Could you help me to do this?




Aucun commentaire:

Enregistrer un commentaire