0% found this document useful (0 votes)
5 views

Java Arrays

Uploaded by

Dhavan Kumar
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Java Arrays

Uploaded by

Dhavan Kumar
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Java Arrays:

* Array -> Collection of same type elements


-> Homogeneous type
-> Group of memory locations, identified by using
a common name, 'ArrayName'
-> each memory location identified by using "Index"
( called "Subscript")number starts with 0

Properties:
* Array fixed in size
* Insertion order
* contigeous memory locations
* allows duplicate values
* by default stores unordered list.

Types of arrays:
* [] are signature of the array
* based on no.of [] used to create an arrays
1.One-Dimensional Arrays(1D arrays)
2.Multi-Dimensional (2D, 3D,...)

One-Dimensional Array:
* It can store one row of elements
* represent "list"

syntax:

Datatype arrayname[]=new Datatype[size];

size -> Number of memeory locations


length -> Number of elements

ex:
int arr[]=new int[5];

You might also like