I encoded something like this in NetBeans:
public class Grafo<V, E>
{
class Par
{
int a, b;
Par(int a, int b) {
this.a = a;
this.b = b;
}
@Override
public boolean equals(Object ob)
{
if(ob instanceof Par) {
Par p = (Par)ob;
return this.a==p.a && this.b==p.b;
}
return false;
}
}
}
Error in equals () method from inner class "Par".
NetBeans says the error is "an illegal common type of instanceof." The error is in the line below.
if(ob instanceof Par) {
What is the cause of the error?
source
share