Java array
•
Java
There are several ways to declare a one-dimensional array:
Int a [] and int [] a
Dynamic initialization: int [] a = New Int [3]
Static initialization: int [] a = New Int [] {1,2,3,4}
double b[]
Mydate [] C / / object array
References to array elements:
There are several ways to declare multidimensional arrays:
Int [] [] A and int a [] [] and int [] a []
Dynamic initialization: int [] [] a = New Int [3] [];
Static initialization: int [] [] a = New Int [] [] {{1,2}, {3,4}}
Traversal of two-dimensional array:
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码