-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArrays.java
More file actions
46 lines (37 loc) · 1.07 KB
/
Copy pathArrays.java
File metadata and controls
46 lines (37 loc) · 1.07 KB
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
44
45
46
/*
* Arrays.java
*
*/
/**
*
* @author aharris
*/
public class Arrays {
public static void main(String args[]){
String[] games = {
"Super Mario Bros.",
"Legend of Zelda",
"Tetris",
"Civilization II",
"Super Mario 64",
"Pirates!",
"StarCraft",
"Street Fighter II",
"Star Wars TIE Fighter",
"Super Metroid"
};
System.out.println(games[3]);
for (int i = 0; i < games.length; i++){
//System.out.printf("%d) %s\n", i+1, games[i]);
System.out.println((i + 1) + ") " + games[i]);
} // end for
//creating an empty array
String[] gameSeries = new String[3];
gameSeries[0] = "Rogue";
gameSeries[1] = "Civilization";
gameSeries[2] = "Command and Conquer";
for (int i = 0; i < gameSeries.length; i++){
System.out.println(gameSeries[i]);
} // end for loop
} // end main
}