1public static void main(String[] args) {
2/*
3 *
4 * *
5 * * *
6 * * * *
7 * * * * *
8 * * * * * *
9 * * * * * * * */
10
11 int z = 1;
12 while (z<=7){ // z value repeat
13
14 int i = 1;
15 while (i <= z){
16 System.out.print("* ");
17 i++;
18 }
19 System.out.println();
20 z++;
21 }
22 System.out.println("==============");
23
24 int z2 = 7;
25 while (z2 >= 1){ // z value repeat
26
27 int i2 = 1;
28 while (i2 <= z2){
29 System.out.print("* ");
30 i2++;
31 }
32
33 System.out.println();
34 z2--;
35 }
36
1graphics.drawPolygon(new int[] {10, 20, 30}, new int[] {100, 20, 100}, 3);
2// Graphics.drawPolygon(x-coordinates, y-coordinates, # of points);