I can't get what I'm missing here. Both replace and replaceAll from java.lang.String are generating a question mark (?) after each ocurrence:
String str = "ABCD DKABCED DLS ABC";
System.out.println("str='"+str+"'");
System.out.println("str.replaceAll(\"ABC\", \"A\\\\${BC}\" ) => " + str.replaceAll("ABC", "A\\${BC}" ));
System.out.println("str.replace(\"ABC\", \"A${BC}\" ) => " + str.replace("ABC", "A${BC}" ));
Generates the following output:
str='ABCD DKABCED DLS ABC'
str.replaceAll("ABC", "A\\${BC}?" ) => A${BC}?D DKA${BC}?ED DLS A${BC}?
str.replace("ABC", "A${BC}?" ) => A${BC}?D DKA${BC}?ED DLS A${BC}?
Here an image of the execution:

Does anybody knows why?
EDITED:
Just for the record. The problem it that there really WAS a character after the brackets.
After coping and pasting to Notepad++ I could see the }?"text. Not in Netbeans.
So purelly enconding missunderstanding.
$?