Converting IntWritatble to int
<p>I have the following code and I didn't understand why <code>get()</code> method has been used in the highlighted line. If I remove that <code>get()</code> method it throws me an error.</p>

<p>What I can take out from it is: <code>get()</code> method returns the int value of the IntWritable. Correct me if I am wrong.</p>

<pre><code>public void reduce(IntWritable key, Iterator&lt;IntWritable&gt; values, OutputCollector&lt;IntWritable, IntWritable&gt; output, Reporter reporter) throws IOException {
    int sum = 0;
    while (values.hasNext()) {
        sum += values.next().get(); //error when removing the get()    
    }
}
</code></pre>