编程语言

img BlessK

Welcome.java

发表于2004/10/27 23:27:00  794人阅读

分类: Java Program

//first Java program Welcome.java
public class Welcome
// Welcome is class,the first letter of the class's name should be capitalization 
{
   public static void main(String[] args)
   {
      String[] greeting = new String[3];
      greeting[0] = "Welcome to Core Java";
      greeting[1] = "by Cay Horstmann";
      greeting[2] = "and Gary Cornell";

      for (int i = 0; i < greeting.length; i++)
         System.out.println(greeting[i]);
   }
}

Execute

by Cay Horstmann
and Gary Cornell

Process completed.

阅读全文
0 0

相关文章推荐

img
取 消
img