// package chapter5; /** * Title: Chapter 5, "Arrays" * Description: Examples for Chapter 2 * Copyright: Copyright (c) 2000 * Company: Armstrong Atlantic State University * @author Y. Daniel Liang * @version 1.0 */ // TestCopyArray.java: Demonstrate copying arrays public class TestCopyArray { /**Main method*/ public static void main(String[] args) { // Create an array and assign values int[] list1 = {0, 1, 2, 3, 4 ,5}; // Create an array with default values int[] list2 = new int[list1.length]; // Assign array list1 to array list2 list2 = list1; // Display list1 and list2 System.out.println("Before modifying list1"); printList("list1 is ", list1); printList("list2 is ", list2); // Modify list1 for (int i=0; i