While studying for a test in my OOP course, I came upon this question which had an answer I didn't really understand. The question is as follows (translated):The programming language Sava is similar to Java in every way except in the following: It's structurally typedWhen overriding a method the argument can be contravariant and the return type can be covariant.  Given the following class and interface, is the following assignment legal?  interface I{    boolean equals(I i){}  }   class C{    boolean equals(C c){}  }I i = new C();The answer that was given to this question was:The assignment isn't legal. The equals method in C changes the paramater in a covariant way and so it doesn't match the equals method in I.At first I thought the professor forgot to add Implements I but the answer also stated the following:Answers that refereed to the fact that C doesn't implement I weren't accepted because given that it's a Structurally Typed language it doesn't matter if it were a subtype. I'm not sure I understand how we can refer to these methods as covariant / contravariant if there is no relation of subtyping between C and I. Can anyone clear this up for me?
Java, strong typing, covariance and contra-variance
type theory;java