title: String's replaceAll() method and escape characters
body: <p>The line</p>
  
  <pre><code>System.out.println("\\");
  </code></pre>
  
  <p>prints a single back-slash (<code>\</code>). And</p>
  
  <pre><code>System.out.println("\\\\");
  </code></pre>
  
  <p>prints double back-slashes (<code>\\</code>). Understood!</p>
  
  <p>But why in the following code:</p>
  
  <pre><code>class ReplaceTest
  {
      public static void main(String[] args)
      {
          String s = "hello.world";
          s = s.replaceAll("\\.", "\\\\");
          System.out.println(s);
      }
  }
  </code></pre>
  
  <p>is the output:</p>
  
  <pre><code>hello\world
  </code></pre>
  
  <p>instead of</p>
  
  <pre><code>hello\\world
  </code></pre>
  
  <p>After all, the <code>replaceAll()</code> method is replacing a dot (<code>\\.</code>) with (<code>\\\\</code>).</p>
  
  <p>Can someone please explain this?</p>