title: Converting object of a class to of another one
body: <p>I have two classes which have are nearly equal except the data types stored in them. One class contains all double values while other contains all float values.</p>
  
  <pre><code>class DoubleClass
  {
      double X;
      double Y;
      double Z;
  }
  
  class FloatClass
  {
      float X;
      float Y;
      float Z;
  }
  </code></pre>
  
  <p>Now I have a point of DoubleClass which I want to convert to FloatClass.</p>
  
  <pre><code>var doubleObject = new DoubleClass();
  
  var convertedObject = (FloatClass)doubleObject; // TODO: This
  </code></pre>
  
  <p>One simple way is to make a method which creates a new FloatClass object, fills all values and return it. Is there any other efficient way to do this.</p>