Java array

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
分享
二维码
< <上一篇
下一篇>>