您的位置:首页 > 其它

数组的声明及输出

2016-03-11 23:00 148 查看
public class Test{

 public static void main(String args[]){

  int score[] = null;

  score = new int[3];

  System.out.println("score[0] =
"+score[0]);

  System.out.println("score[1] =
"+score[1]);

  System.out.println("score[2] =
"+score[2]);

  for(int
i=0;i<score.length;i++){

   System.out.println("score["+i+"]
= "+score[i]);

  }

 }

}





运行结果:



内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: