I have a class that has multiple instances of itself, and was wondering if there was a way to override or supress the warning "Variable 'x' might not have been initialized".
class Main{
public Main(){
Astronaut.GenerateData(5);
Astronaut me = new Astronaut();
}
}
class Astronaut extends Player{
private static final int HEIGHT;
public Astronaut(){
super();
/*Does stuff*/
}
public static void GenerateValues(int valueToBeUsed){
HEIGHT=valueToBeUsed;
}
}
I have tried many different options, I know ways around this problem, but overall the code would be cleaner if I can do it this way.