If you don't like to read the (not very lean) javadoc-pages, to find the solution, you make a small test-program:
Code:
final String oriLine = "?/)&+%!";
System.out.println (oriLine.replaceAll("\\?", "1"));
System.out.println (oriLine.replaceAll("\\)", "2"));
// ...
And so on.
This way you find very fast (took me 2 mins) which character needs to be escaped.
For later usage, it's good practice, to have a snipplet-template, which creates a testfile, named dynamically, containing a class, a main method and constructor, where you only need to insert your testcode, but which can be saved for later usage.
The dynamic name is important, to store different tests without loosing time, and to work on multiple testings at the same time.
I just called
and could start testing.
You will not believe how many time you save, if you spend it once to generate a template.
seeking a job as java-programmer in Berlin: