Topics - Basic Program Structure

Total Page:16

File Type:pdf, Size:1020Kb

Topics - Basic Program Structure

C5: Internet Programming J013 - MarkList(1)

Topics - Arrays. 12 public class MarkList 13 { Introduction 14 int [] mark; 15 Why can't the constructor just say A set of students' marks are stored in an array of type int. This example shows 16 public MarkList(int [] mark) how to list all of the elements of the array, find the largest element and the total. 17 { this.mark = mark; 18 this.mark = new int[mark.length]; Instructions 19 for (int i=0; i

61 }// end class MarkList

© Faculty of Computing, Information and English Page 2 of 1 Version 1.1, July 2002 087016fe37746053e6b1a548e6a85386.doc

Recommended publications