public boolean equals(Object o) {
if( !(o instanceof TypedValue)){
return false;
}
else{
if (o.type() == this.type()){
//stuff
}
}
(im a java noob) this code is from my TypedValue class, I get an error on the o.type() as type() isnt a method of object. But type() is a method of Typedvalue and o must be an instance of TypedValue. I can cast to remove the error but im not sure if my code will work in the correct way. Its important to the rest of the code that the function take an object as its parameter and not just a typedvalue