title: Convert Float to Int Discrepancy
body: <p>I cannot seem to figure out why I can convert a float to an int doing the following:</p>
  
  <pre><code>float a = 3;
  int b = (int)a;
  </code></pre>
  
  <p>but when I try the following:</p>
  
  <pre><code>public class MyTestCode{
      public static int Add(Object a, Object b){
          int c = (int)a;
          int d = (int)b;
          return c + d;
      }
  }
  </code></pre>
  
  <p>...it gives the following error:</p>
  
  <pre><code>*Exception in thread "main" java.lang.ClassCastException: java.lang.Float cannot be cast to java.lang.Integer
  at myTestCode.MyTestCode.Add(MyTestCode.java:15)
  at ch02.ex01.Ch02Ex01.main(Ch02Ex01.java:25)
  Java Result: 1*
  </code></pre>
  
  <p>Why can I convert from float to int in the one example, but not the other?</p>