Your first example won't compile; you can't assign a
String to an array variable. Maybe you meant
char[] = "ABCD\r\n".toCharArray()?
In that case, the answer is six. You'll have to tell us where you read that there should be seven characters. I can't imagine what you mean with regards to Strings having "one more '\n'" : nothing of the sort is true.
As to your second example: your code is much closer to C++ than to
Java. A Java version might look like:
This program prints 2, as you'd expect. Unless you're reading it wrong, I think the best thing to do with the mock exam you're using is to line a birdcage with it, and find some other references.
I'm going to move this to
SCJP, where this sort of question is on-topic.