Created
September 6, 2016 04:50
-
-
Save jayjaykim/56f7df3228a4eab116ee3aa60c816db1 to your computer and use it in GitHub Desktop.
TestForEach.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TestForeach { | |
public static void main(String[] args) { | |
String[] msgs = {"aa", "bb", "cc", "dd"}; | |
String[] msg1 = new String[]{"aa", "bb", "cc", "dd"}; | |
final int size = msg1.length; | |
for(int i = 0; i < size; i++) { | |
System.out.println(msgs[i]); | |
} | |
// a | |
// b | |
System.out.println("-----------"); | |
// for-each | |
for(String str : msgs) { | |
System.out.println(str); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment