title: String encoding (UTF-8) JAVA
body: <p>Could anyone please help me out here. I want to know the difference in below two string formatting. I am trying to encode the string to UTF-8. which one is the correct method.</p>
  
  <pre><code>String string2 = new String(string1.getBytes("UTF-8"), "UTF-8")); 
  </code></pre>
  
  <p>OR</p>
  
  <pre><code>String string3 = new String(string1.getBytes(),"UTF-8"));
  </code></pre>
  
  <p>ALSO if I use above two code together i.e.</p>
  
  <pre><code>line 1 :string1 = new String(string1.getBytes("UTF-8"), "UTF-8")); 
  line 2 :string1 = new String(string1.getBytes(),"UTF-8")); 
  </code></pre>
  
  <p>Will the value of string1  will be the same in both the lines?</p>
  
  <p>PS: Purpose of doing all this is to send Japanese text in web service call.
  So I want to send it with UTF-8 encoding.</p>