-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestArrays.java
More file actions
41 lines (35 loc) · 822 Bytes
/
TestArrays.java
File metadata and controls
41 lines (35 loc) · 822 Bytes
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
/**
*
*/
/**
* @author DELL
* Project Name: Java_learn
* Class Name: TestArrays
* date: 2019年8月19日{time}
*/
public class TestArrays {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String [] islands = new String[4];
islands[0] = "Bermude";
islands[1] = "Fiji";
islands[2] = "Azores";
islands[3] = "Cozumel";
int [] index = new int[4];
index[0] = 1;
index[1] = 3;
index[2] = 0;
index[3] = 2;
int y = 0;
int ref;
while (y < 4) {
ref = index[y];
System.out.print("island = ");
System.out.println(islands[ref]);
y = y + 1;
}
}
}