下面的代码给我:局部变量str可能没有被初始化publicclassexperiment{publicstaticvoidmain(String[]args){intday=1;Stringstr;switch(day){case1:str="nice";break;}System.out.println(str);}}所以,我给str一个null值,它起作用了,但我仍然想知道为什么文档上的那个没有先初始化值就起作用,我我已经检查了三遍,我认为我没有任何拼写错误:publicclassSwitchDemo{publicstaticvoidmain(String[]args){intmo