java 来自https://docs.oracle.com/javase/tutorial/java/nutsandbolts/arrays.html

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了java 来自https://docs.oracle.com/javase/tutorial/java/nutsandbolts/arrays.html相关的知识,希望对你有一定的参考价值。

class ArrayDemo {
    public static void main(String[] args) {
        // declares an array of integers
        int[] anArray;

        // allocates memory for 10 integers
        anArray = new int[10];
           
        // initialize first element
        anArray[0] = 100;
        // initialize second element
        anArray[1] = 200;
        // and so forth
        anArray[2] = 300;
        anArray[3] = 400;
        anArray[4] = 500;
        anArray[5] = 600;
        anArray[6] = 700;
        anArray[7] = 800;
        anArray[8] = 900;
        anArray[9] = 1000;

        System.out.println("Element at index 0: "
                           + anArray[0]);
        System.out.println("Element at index 1: "
                           + anArray[1]);
        System.out.println("Element at index 2: "
                           + anArray[2]);
        System.out.println("Element at index 3: "
                           + anArray[3]);
        System.out.println("Element at index 4: "
                           + anArray[4]);
        System.out.println("Element at index 5: "
                           + anArray[5]);
        System.out.println("Element at index 6: "
                           + anArray[6]);
        System.out.println("Element at index 7: "
                           + anArray[7]);
        System.out.println("Element at index 8: "
                           + anArray[8]);
        System.out.println("Element at index 9: "
                           + anArray[9]);
    }
} 

以上是关于java 来自https://docs.oracle.com/javase/tutorial/java/nutsandbolts/arrays.html的主要内容,如果未能解决你的问题,请参考以下文章

来自客户端的 Java (Tomcat) websocket 参数

Java:没有来自外部类的 ArrayList 修改

java 来自http://javabeat.net/java-getresourcestream/

Java:字体不加载(来自外部文件)

java Java中的缓存反射访问(来自Spring Framework代码库)

来自命令行的 Java 堆空间错误