Type <METHOD_NAME> is erroneous
I get a weird compilation error in Netbeans.
I am creating an Experiment object and calling the run method on it.
Experiment experiment=new Experiment();
Result result = experiment.run(t, steps, trials, breadth, depth, seed, distribution);
The compiler complains that
The startup type (Maplayout, int, int, int, int, long, int) is erroneous.
My method signature looks fine:
public Result run(MapLayout t, int steps, int trials,
int breadth, int depth, long seed, int distribution)
I double-checked the parameters that I enter, and they all seem normal. If I pass:
experiment.run(null, 1,1,1,1,1l,1);
I get the same run method compilation error.
Am I missing something? Too much javascript has damaged my brain?
+4
6 answers
NetBeans 8.0. , :
ClassA:
public interface ClassA {
}
ClassB:
import ClassA;
public class ClassB implements ClassA {
}
ClassC:
import ClassB;
public class ClassC extends ClassB {
}
ClassD:
import ClassC;
import ClassA;
public class ClassD {
public ClassA getClassA() {
return new ClassC(); // error here
}
}
:
path\to\ClassC.java:7: error: The type of new ClassC() is erroneous
return new ClassC();
^
ClassC ClassA, , . , ClassC ClassA, ClassB:
new ClassC:
import ClassA;
import ClassB;
public class ClassC extends ClassB implements ClassA {
}
+4