title: Modulus operator in java
body: <p>I have some confusion on the modulus operator, modulus gives the remainder as the output. so why is it different for the below scenario?</p>
  <pre><code>public class ModulusTest{
         public static void main(String[] args) {
          
           System.out.println(&quot; 7/10 : &quot; + 7/10 );//0.7
           System.out.println(&quot; 7%10 : &quot; + 7%10 ); //0
           
           System.out.println(&quot; 5/2 : &quot; + 5/2 );//2
           System.out.println(&quot; 5%2 : &quot; + 5%2 );//1
  }
  }
  </code></pre>
  <p>The output i was expecting is as i kept in the comments on each line of the print statements in the above sample code.
  output:</p>
  <pre><code> 7/10 : 0
   7%10 : 7
   5/2 : 2
   5%2 : 1
  </code></pre>