Topic 2 - Array
Topic 2 - Array
Topic 2 : Array
Data types
Definition of Data Structures
Java Collection Framework
Review
Java Abstract Classes
Java Interfaces
Collection hierarchy
Array definition
Array implementation
ArrayList
User-defined
Homogenous
Array only stores data of the same type.
Fixed-size
In general, the size of array is fixed upon creation.
Random access
Element of an array can access in random
public myArray(){
newArray = new int[10];//Create array of 10 elements
size = 0;
System.out.println("Array Created.");}
Constructor to initialize
the array
Compiled & edited by: Zahid Zainal
User-defined array (cont.)
Linear list
Linked List
Concept
Implementation
Application