I think this is simple question, but I stuck on it. I am trying to assign one Set to another:
Set<Registrable> rr =kart.getReg();
where kart.getReg() return Set of Reg:
public class Kart {
public Set<Reg> getReg() {
return reg;
}
...
but "Registrable" is an interface, defined like:
public interface Registrable {
getters...
setters...
}
and finally the class "Reg" is:
public class Reg implements Registrable {
getters...
setters...
}
and my compiler wrote:
Type mismatch: cannot convert from Set<Reg> to Set<Registrable>
Any help will be appreciated!