Please look at the following two codes (selected from Core Java 5e and Core Java 7e), and the blue is used to indicate. Procedure 1: Public class welcome {public static void main (string [] args) {string [] Greeting = new string [3]; greeting [0] = "welcome to core java"; greeting [1] = "by cary Horstmann "; Greeting [2] =" And Gary Cornell ";
For (int i = 0; i
For (String g: greeting) system.out.println (g);}}
The results of these two programs are the same, all: Welcome to Core Java by Cay Horstmann and Gary Cornell, if you use JDK1.4 or the following version, you will be wrong, and you can pass it. This illustrates this ":" operator is one of the new features of JDK1.5.