title: How do I print escape characters in Java?
body: <p>When I have a string such as:</p>
  
  <pre><code>String x = "hello\nworld";
  </code></pre>
  
  <p>How do I get Java to print the actual escape character (and not interpret it as an escape character) when using <code>System.out</code>?</p>
  
  <p>For example, when calling</p>
  
  <pre><code>System.out.print(x);
  </code></pre>
  
  <p>I would like to see:</p>
  
  <pre><code>hello\nworld
  </code></pre>
  
  <p>And not:</p>
  
  <pre><code>hello
  world
  </code></pre>
  
  <p>I would like to see the actual escape characters for debugging purposes.</p>