数组的声明及输出

来源:互联网 发布:统计分析软件 编辑:程序博客网 时间:2024/05/21 22:56

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(inti=0;i<score.length;i++){
   System.out.println("score["+i+"]= "+score[i]);
  }
 }
}

数组的声明及输出

运行结果:

数组的声明及输出

0 0
原创粉丝点击