I'm trying to create a constructor inside an abstract class and then make two other classes extend it. But - I get this yellow line under some variable saying it never read locally, but if I delete it, I get compilation errors.
It looks like this:
public abstract class SizeFilters {
private double value; // this one never read locally
private int MIN_VALUE = 0;
public SizeFilters(double value) {
if (value >= MIN_VALUE) {
this.value = value;
} else {
throw new IllegalArgumentException(
"Value must be a positive number.");
}
}
And the class that extends:
public class GreaterThanFilter extends SizeFilters {
private double value;
public GreaterThanFilter(double value) {
super(value);
}
Should I ignore that warning or is there something I do wrong?
Thanks a lot!!!
When i balance a chair in magma, why hurts my neck?Give me a realistic situation for the code, and theyellow linewill be disappear as well as the question disappears!