I have a class in which there is a method that terminates the program in case a string has the NUL character in it. The particular expression is this:
stringVar.indexOf('\u0000') < 0
This string is read from the user via Scanner and I really wonder how a NUL character may end up in the string through an input from the user.
Edit: Scanner reads the code as follows:
Scanner scannerVar = new Scanner(System.in);
stringVar = scannerVar.next();