I have this piece of code that generates a random characters (ASCII)
public char getRandChar(){ return (char)rand.nextInt(27); }
and then I’ll print it out using this
System.out.println(new Character(getRandChar()));
How but apparently it is returning a blank value
This is because
rand.nextInt(27);is returning unprintable character codes. This will be evident if you change your code toreturn (char)65;for example.