如何填写阵列在Java中? [英] How do I fill arrays in Java?
本文介绍了如何填写阵列在Java中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我知道怎么做了正常,但我可以发誓,你可以填写了像[0] = {0,0,0,0};你怎么做呀?我曾尝试谷歌,但我没有得到任何帮助。
I know how to do it normally, but I could swear that you could fill out out like a[0] = {0,0,0,0}; How do you do it that way? I did try Google, but I didn't get anything helpful.
推荐答案
您也可以做到这一点作为声明的一部分:
You can also do it as part of the declaration:
int[] a = new int[] {0, 0, 0, 0};
这篇关于如何填写阵列在Java中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文