Created
September 19, 2018 03:53
-
-
Save devDeejay/2be237060d782a0c96f6b0728198de6c to your computer and use it in GitHub Desktop.
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
| import java.util.Arrays; | |
| import java.util.List; | |
| public class Demo { | |
| public static void main(String[] args) { | |
| String[] array = {"Hello", "World"}; | |
| List<String> list = Arrays.asList(array); | |
| for (String s : list) { | |
| System.out.println(s); | |
| } | |
| System.out.println("======="); | |
| array[0] = "Yo"; | |
| for (String s : list) { | |
| System.out.println(s); | |
| } | |
| /** | |
| * Generates The Following Output (Ignore The '*') | |
| * Hello | |
| * World | |
| * ======= | |
| * Yo | |
| * World | |
| */ | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment