Creating an array of Java

// Array 

// 1. Arrays are a very important part of Java, the array is today a general understanding, Java and C arrays in an array or a certain difference 

// The following is a summary of several methods 
public class {FirstP1 
    public static void main (String [] args) { 

       // create a first method: 
        int [] = new new the nums int [] {1,5,6,9,7}; 
        // NOTE: new int [] figures in parentheses have not; 

        // Create a second method: 

         int [] = {1,2,3,4,5} A; 
        // this method uses C language used is similar 

         // Create a third method 
        B int [] = new new int [. 6]; 
        B [. 1] =. 1; 
        B [2] = 2; 
        // fact equivalent to create an object 
    } 
}

Guess you like

Origin www.cnblogs.com/ouyangbo12/p/12132347.html