title: Java: double vs float
body: <p>In another Bruce Eckel exercise, the code I've written takes a method and changes value in another class.  Here is my code:</p>
  <pre><code>class Big {
    float b;
  }
  
  public class PassObject {
    static void f(Letter y) {
      y.c = 'z';
    } //end f()
    static void g(Big z) {
      z.b = 2.2;
    }
  
    public static void main(String[] args ) {
      Big t = new Big();
      t.b = 5.6;
      System.out.println(&quot;1: t.b : &quot; + t.b);
      g(x);
      System.out.println(&quot;2: t.b: &quot; + t.b);
    } //end main
  }//end class
  </code></pre>
  <p>It's throwing an error saying &quot;Possible loss of precision.&quot;</p>
  <pre><code>PassObject.java:13: possible loss of precision
  found: double
  required : float   z.b = 2.2
  passobject.java:20: possible loss of precision
  found : double
  required : float   t.b = 5.6
  </code></pre>
  <p>Can't <code>double</code>s be <code>float</code>s as well?</p>