forked from AllenDowney/ThinkJavaCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlanetTester.java
More file actions
32 lines (29 loc) · 915 Bytes
/
PlanetTester.java
File metadata and controls
32 lines (29 loc) · 915 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
public class PlanetTester
{
public static void main(String[] args)
{
Planet mercury = new Planet("Mercury");
Planet venus = new Planet("Venus");
Planet earth = new Planet("Earth");
Planet mars = new Planet("mars");
Planet jupiter = new Planet("Jupiter");
Planet saturn = new Planet("Saturn");
Planet uranus = new Planet("Uranus");
Planet neptune = new Planet("Neptune");
Planet pluto = new Planet("Pluto");
Planet[] planets = new Planet[9];
planets[0] = mercury;
planets[1] = venus;
planets[2] = earth;
planets[3] = mars;
planets[4] = jupiter;
planets[5] = saturn;
planets[6] = uranus;
planets[7] = neptune;
planets[8] = pluto;
for(int i=0;i<planets.length;i++)
{
System.out.println(planets[i].getName());
}
}
}