
Arrays 4.13
for(int i=0;i<myArray.length;i++)
System.out.print(“ “ + myArray[i]);
copyArray=obj.Copy(myArray);
System.out.println(“ \nCopied Array ......”);
for(int i=0;i<copyArray.length;i++)
System.out.print(“ “ + copyArray[i]);
}
}
Output : Given Array ...... 10,15,20,30,35
Copied Array ......”) 10,15,20,30,35
4.3.7 Multi-dimensional Arrays
Arrays can have more than one dimension. For example, a matrix is a two-dimensional array
with a number of rows and a number of columns as show in Figure 4.4.
As an example, to demonstrate the two-dimensional arrays we would consider the prob-
lem of finding a transpose of a matrix.
Example 4.9: MatTranspose.java ...