Here I am, thinking I know Java, and I get the error Variable 'storage' might not have been initialized
. Here is my code:
public class RobbleSet {
private final Set<Robble> storage; // Error occurs here
public RobbleSet() {
storage = new HashSet<Robble>();
}
public addRobble(Robble r) {
storage.add(r); // Error occurs here too
}
}
storage
is initialized in the constructor. What gives?