「Java入門」equals()メソッドを利用する

1.equals()
例1
Integer intA = new Integer(33);
Integer intB = new Integer(33);
System.out.println(intA.equals(intB)); //true

例2
String strA = “abcde";
String strB = “abcde";
System.out.println(strA == strB); // true

2.==演算子
int intC = 44;
int intD = 44;
System.out.println(intC == intD); // true

Software

Posted by arkgame