代码
提交代码
public class ForEachLoop { public static void main(String[] args) { // 初始化字符串数组 words String[] words = {"Welcome ", "to ", "imooc"}; for(String word: words) { System.out.print(word); } } }
运行结果