forked from mr-robot-2008/js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArray.java
More file actions
14 lines (14 loc) · 406 Bytes
/
Copy pathArray.java
File metadata and controls
14 lines (14 loc) · 406 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//Java Program to illustrate how to declare, instantiate, initialize
//and traverse the Java array.
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]);
}}