集册 Java实例教程 创建数组并使用常量值初始化它的简便方法:

创建数组并使用常量值初始化它的简便方法:

欢马劈雪     最近更新时间:2020-01-02 10:19:05

666
创建数组并使用常量值初始化它的简便方法:

public class Main {


  public static void main(String[] args) {
  /** 
   来自 NowJava.com - 时代Java**/

    String[] days = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday",

        "Friday", "Saturday" };


    int[] primes = { 2, 3, 5, 7, 11, 13, 17 };


    primes = new int[] { 2, 3, 5, 7, 11, 13, 17 };

  }


}
/* 
 来自 
*NowJava.com*/