/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package test;
/**
*
* @author huanghuankun
*/
public class ArrayInit {
public static void main(String[] args){
int[] array = new int[1];
System.out.println("array="+array);//地址
System.out.println("array[0]="+array[0]);//数组初始化默认为0
System.out.println("array.equals(0)="+array.equals(0));//不会报编译错误或者运行时错误,返回false
}
}
输出:
array=[I@20e5f01b
array[0]=0
array.equals(0)=false