title: Java float to int conversion error
body: <p>Hey Guys I am using a list of lists in java.The list is called deg_grp and the code below shows the output of the deg_grp at a particular index j.</p>
  
  <pre><code>for(int k=0;k&lt;deg_grp.get(j).size();k++)
  {
       System.out.println(deg_grp.get(j).get(k));
  }
  </code></pre>
  
  <p>The output is:</p>
  
  <pre><code>1.0
  2.0
  4.0
  6.0
  8.0
  </code></pre>
  
  <p>So these are my values. But when I replace the print command by </p>
  
  <pre><code>System.out.println((int)deg_grp.get(j).get(k));
  </code></pre>
  
  <p>It is throwing me an error.I need to perform int conversion for indexing purposes later on.The error is:</p>
  
  <blockquote>
    <p>incompatible types: Float cannot be converted to int </p>
  </blockquote>
  
  <p>So I am unable to run the code. Kindly help me out. Thanks :)</p>