Weird Behaviour of String
I have a tricky qn.
I have a string declared like the following:
String a = "\010";
and if i do a toCharArray() i will get a char array of size 1 which is what i want.
however when i did a scanner like the following:
Scanner inputReader = new Scanner(System.in);
input = inputReader.nextLine();
and when i enter \010 into the scanner, even when i print input,
it gives me
but when i do a toCharArray(), it ended up giving me 4 char; \ , 0, 1, 0
Why is this so? if i need to do a scanner, how can i make sure that when i do a toCharArray(), i will get a size 1 char array with \010 as the char element.