public class HelloWorld { public static void main (String args[]) { int i = 0; String greetings [] = { "Hello world!", "No, I mean it!", "HELLO WORLD!!" }; while (i < 4) { System.out.println (greetings[i]); i++; } } }//源代码片段来自云代码http://yuncode.net