我的第一个Java程序

 1 package hi;
 2 
 3 public class Star {
 4 
 5     /**
 6      * @param args
 7      */
 8     public static void main(String[] args) {
 9         int j;
10         for(int i=0;i<8;i++){
11             
12             for(j=0;j<=i;j++)
13                 System.out.print("*");
14             while(j<14-i){
15                 System.out.print(" ");
16                 j++;
17             }
18             while(j<15)
19             {
20                 System.out.print("*");
21                 j++;
22             }
23             System.out.println();
24         }
25         for(int i=7;i>0;i--){
26             
27             for(j=0;j<i;j++)
28                 System.out.print("*");
29             while(j<=14-i){
30                 System.out.print(" ");
31                 j++;
32             }
33             while(j<15)
34             {
35                 System.out.print("*");
36                 j++;
37             }
38             System.out.println();
39         }
40         
41     }
42 
43 }
原文地址:https://www.cnblogs.com/CheeseIce/p/10480160.html