I need to make equals function for MyClas.
public class MyClass
{
boolean equals(Object value)
{
if (... value is type of MyCLass ...)
{
return= ... check conditions...;
} else return false;
}
}
For this purpose I need to know if value of Object is type of MyClass. How to make it?
In order to check if value
is of type MyClass
use:
if( value instanceof MyClass)