Array initialisation in java

前端 未结 5 1913
忘掉有多难
忘掉有多难 2020-12-01 23:20

I noticed one could write code like this, which is perfectly normal, by the way:

int arrays[] = {1, 2, 3};
for (int n : arrays)
   System.out.println(n);
         


        
5条回答
提交回复
热议问题