- public class IntegerDemo1 {
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- Integer x= new Integer("123");
- Integer y=new Integer(123);
- sop("x==y"+(x==y));
- sop("x.equqls(y)"+x.equals(y));//在这里返回值为什么是true呢?
- }
- public static void sop(String str){
- System.out.println(str);
- }
- }
复制代码
|