I'm trying to restructure some of my code and realized that I need to create an abstract class to have abstract methods. However, I'm having a problem with typing and am not sure what the problem is (and, therefore, not sure what the solution is). I have the abstract superclass:
abstract public class CondInd<T> {
abstract public double score(CondInd<T> n);;
abstract public ArrayList<Collection<CondInd<T>>> search();;
abstract public void increaseScore(Set<CondInd<T>> input);;
}
and I have my subclass:
public class Node<T> extends CondInd<T> {
public double score(Node<T> nodelst){ //EDITED thanks to Martin
return 0.0;
}
public ArrayList<Collection<Node<T>>> search(){ //To Implement
return new ArrayList<Collection<Node<T>>>();
}
The problems I'm having is the implemented methods in Node aren't overriding those in the superclass because it says the return types of the implemented methods in Node don't match those in the superclass.
It's something to do with typing but I'm not very good with generic types and abstract classes.