



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Notes; Professor: Tanner; Class: Introduction-Computer Science; Subject: Computer Science; University: West Virginia University; Term: Unknown 2009;
Typology: Study notes
1 / 6
This page cannot be seen from the preview
Don't miss anything!




System.out.println (“the max is: “ + max); System.out.println (“the min is: “ + min);
Write the same method for arrays of strings:
int [] createCopy (int [] a) { int [] copy = new int [a.length];
for (int i =0; i< a.length; i++) copy [i]= a[i]; return copy; }
Consider arrays a,b. and c a = b+c;
not defined in java….it is defined in MATLAB
int [] addArrays (int [] a, int []b) { int [] sum = new int [a.length]; if (a.length != b.length) System.out.println(“can’t add arrays they are not of the same length”); else { for (int i=0; i<a.length;i++)
sum[i]=a[i]+b[i]; }
return sum; }
Names Æ 0 ----Æ Joe 1 ---Æ Sally 2 ---Æ Susie 3 ---Æ John
Must use the objects methods to manipulate it
names[0].equals(“Sam”)