title: Explanation of output of a java program
body: <p>I came across the following program </p>
  
  <pre><code>class Boolean {  
    public static void main(String argv[]) {  
      boolean x;  
      x = 4.4f == 4.4;  
      System.out.println(x);  
    }  
  } 
  </code></pre>
  
  <p>The output of the following program is <code>false</code></p>
  
  <p>But if we write the program in the following fashion, then </p>
  
  <pre><code>class Boolean {  
      public static void main(String argv[]) {  
        boolean x;  
        x = 4.5f == 4.5;  
        System.out.println(x);  
      }  
  }
  </code></pre>
  
  <p>In this case the output is <code>true</code></p>
  
  <p>Can somebody explain me why ??</p>