title: Convert a double to a String in Java and vice versa without losing accuracy
body: <p>A <em>String</em> representation of a <em>double</em> is written to and read from a file by a <strong>C#</strong> application.</p>
  
  <p>The C# application converts the double to a string using the following fragment:</p>
  
  <pre><code>value.ToString("R", NumberFormatInfo.InvariantInfo);
  </code></pre>
  
  <p>The C# application converts the string to a double using the following fragment</p>
  
  <pre><code>double num = double.Parse(s, NumberStyles.Float, (IFormatProvider) NumberFormatInfo.InvariantInfo);
  </code></pre>
  
  <p>If that same file were to be written to and read from by a <strong>Java</strong> application, how would you go about converting the types without losing data?</p>