• 2022-06-06
    阅读下面的代码:publicclassExample{publicstaticvoidmain(String[]args){String[]strs={"Tom","Jerry","Donald"};//foreach循环遍历数组for(Stringstr:strs){str="Tuffy";}System.out.println(strs[0]+","+strs[1]+","+strs[2]);}}程序的运行结果是()
    A: Tom,Jerry
    B: Tom,Jerry,Tuffy
    C: Tom,Jerry,Donald
    D: 以上都不对
  • 举一反三