To my understanding following code should run fine.
However, When I try to compile, it is failing at compareTo
public class Test {
Comparable<?> getMinimum() {
return null;
}
public int getPreviousValue(double nv) {
return getMinimum().compareTo(nv);
}
}
So my question is why compilation if failing - are we not allowed to compare null with double?