- Arrays are used to store a list of data in Contiguous memory location.
- Syntax - dataType[ ] name = new datatype[SIZE];
- Arrays are reference types but we can intialize them directly. Ex: int[ ] numbers = {1, 2, 3};
Multi dimensional Array -
These are used when we need an array in different dimensions.
Example: Matrix , Rubik’s Cube.
Arrays Class Methods
- If we want to print our Array on Console : Arrays.toString(Array Name) ;
- It is used to any type of Array primitive (or) reference.
- Sort an Array - Arrays. Sort (Array Name);
Operations
- length
- insertAt()
- removeAt()
- reverse ()
- max()
- index of()
- insert()
- value ()