Chapter1b Array
Chapter1b Array
❖ Introducing Arrays
❖ Declaring Array Variables, Creating Arrays,
❖ and Initializing Arrays
❖ Passing Arrays to Methods
❖ Search and Sorting Methods
❖ Copying Arrays
❖ Multidimensional Arrays
Introducing Arrays
• data structure that represents a collection of the
same types of data or homogeneous elements.
• Structures that related to data items
• It can contain one type of data either:
• Integer
• Floating point
• Numbers
• Characters
Differentiating arrays and lists.
An array is an indexed set of variables and it
store an item.
• datatype arrayname[];
Example:
double myList[];
Creating Arrays
arrayName = new datatype[arraySize];
Example:
myList = new int[10];