I use java. I have two final parameters.
final String para1;
final String para2;
I have a loop to initialize them, for example:
for(int i = 0; i<array.size(); i++){
if(i==array.get(i)){
para1 = something;
para2 = something;
}
}
but intellij will say that: para1 and para2 may not have been initialized. How to change the code? I have to save para1 and para2 final, and I want to assign them null if they are not initialized
source
share