- Notifications
You must be signed in to change notification settings - Fork 348
Expand file tree
/
Copy pathArray
More file actions
Latest commit
12 lines (12 loc) · 302 Bytes
/
Copy pathArray
File metadata and controls
12 lines (12 loc) · 302 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
class Testarray{
public static void main(String args[]){
int a[]=new int[5];//declaration and instantiation
a[0]=10;//initialization
a[1]=20;
a[2]=70;
a[3]=40;
a[4]=50;
//traversing array
for(int i=0;i<a.length;i++)//length is the property of array
System.out.println(a[i]);
}}