DRAFT
Observed
A method with void return type can return a value
A method with void return type cannot return a value
If a method’s return type is void
, then the method cannot return any value.
It could be that this misconception appears because students first learned pure functional programming, where every function would return a value.
Example occurrence of this misconception:
class C {
private int field;
public void modify(int value) {
return field + value; // believes "return" means "do what the name of the method says"?
}
}
The following papers directly or indirectly provide qualitative or quantitative evidence related to this misconception.