Parentheses around data type?

前端 未结 5 1014
醉梦人生
醉梦人生 2020-12-03 12:22

I am a beginning programmer and came across this in my textbook:

public boolean equals(DataElement otherElement)
{
    IntElement temp = (IntElement) otherEl         


        
5条回答
  •  生来不讨喜
    2020-12-03 13:04

    (IntElement) casts otherElement which is of type DataElement to type IntElement

    Check out this link about Java Types and Type Conversion (Casting) for a more thorough description.

提交回复
热议问题