Parentheses around data type?
<p>I am a beginning programmer and came across this in my textbook:</p>

<pre><code>public boolean equals(DataElement otherElement)
{
    IntElement temp = (IntElement) otherElement;            
    return (num == temp.num);
}
</code></pre>

<p><code>IntElement</code> is a subclass of <code>DataElement</code>. <code>num</code> is an int storing a value for a linked list.</p>

<p>What is the purpose of <code>(IntElement)</code> after <code>temp =?</code> What would be wrong with <code>IntElement temp = otherElement</code>? And, in general, what does putting a data type in parentheses like that do?</p>
