-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathElectronicMail.java
43 lines (40 loc) · 1.77 KB
/
ElectronicMail.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//-- type var-name[]; array declaration
//-- type[] var-name;
public class ElectronicMail{
public static void main (String[] args){
String[] EmailArray; // declaration pf array of String data type
EmailArray = new String[25]; //memory allocation in java
EmailArray[0] = "[email protected]";
EmailArray[1] = "[email protected]";
EmailArray[2] = "[email protected]";
EmailArray[3] = "[email protected]";
EmailArray[4] = "[email protected]";
EmailArray[5] = "[email protected]";
EmailArray[6] = "[email protected]";
EmailArray[7] = "[email protected]";
EmailArray[8] = "[email protected]";
EmailArray[9] = "[email protected]";
EmailArray[10] = "[email protected]";
EmailArray[11] = "[email protected]";
EmailArray[12] = "[email protected]";
EmailArray[13] = "[email protected]";
EmailArray[14] = "[email protected]";
EmailArray[15] = "[email protected]";
EmailArray[16] = "[email protected]";
EmailArray[17] = "[email protected]";
EmailArray[18] = "[email protected]";
EmailArray[19] = "[email protected]";
EmailArray[20] = "[email protected]";
EmailArray[21] = "[email protected]";
EmailArray[22] = "[email protected]";
EmailArray[23] = "[email protected]";
EmailArray[24] = "[email protected]";
//EmailArray[25] = "[email protected]";
//EmailArray[26] = "[email protected]"; Error!! shows array index out of bounds
int length = EmailArray.length;
System.out.println("the length of array"+ length);
for (int i=0;i< EmailArray.length ; i++){ //for(initialization; condition; increment/ decrement) requirement of curly braces is optional
System.out.println("the contents of array at index :"+i +" "+EmailArray[i]); // printing array in for loop direct method will bring pnly hex code
}
}
}