国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

作了個小測試equals 和==

2019-11-18 11:19:32
字體:
來源:轉載
供稿:網友

public class Sample{ long length; public Sample(long l){length = l;} public static void main(String arg[]){ Sample s1,s2,s3; s1=new Sample(21L); s2=new Sample(21L); s3=s2; String st1="hello"; String st2="hello"; String st3= new String("hello"); int i=3; Integer j=new Integer(3); float f =3.000f; Float fl =new Float(3.0f); Float f2 =new Float(3.0f); long m=21L; System.out.PRintln(fl.equals(i));//false System.out.println(j.equals(f));//false System.out.println(s1.equals(s2));//true??false!!!!! System.out.println(fl.equals(f2));//true System.out.println(s2==s3);//true System.out.println(s1==s3);//false System.out.println(st1==st2);//true System.out.println(st3==st2);//false System.out.println(fl.equals(3));//false System.out.println(fl==f);//true if(i==f) System.out.println("equal1");//do if(i==fl) System.out.println("equal2");//do if(f2==fl) System.out.println("equal3");//undo if(i==f2) System.out.println("equal4");//do //if(s1==fl)System.out.println("equal3");cannot be compiled! } }



發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 大丰市| 灵宝市| 桃江县| 廉江市| 新蔡县| 永嘉县| 桓台县| 榆社县| 合肥市| 井研县| 和静县| 陵川县| 东港市| 栾川县| 玛多县| 灵武市| 南涧| 敦煌市| 宁陕县| 青川县| 长垣县| 青铜峡市| 称多县| 铜陵市| 沿河| 梧州市| 长春市| 濮阳市| 石门县| 泸定县| 连平县| 大同市| 于都县| 柳州市| 景宁| 白银市| 江达县| 宁晋县| 遵义县| 静海县| 绵竹市|