为什么当我在java中比较两个数组时,结果总是出现false
?
package let3;
public class compare {
public static void main(String[] args) {
/////array with array////
int l[]={5};
int y[]={5};
////compare by == ////
if (l==y){
System.out.println("true ==");
}else{
System.out.println("false ==");
}
///////compare by equal////
if (l.equals(y)){
System.out.println("true equal ");
}else{
System.out.println("false equal ");
}
}
}