== operator for object in Java
In past I don't understand why code in inner block doesn't run.
if (new Integer(1) == new Integer(1)) {
doImportantJob();
};
Since "==" operator for object means if both objects point to the same memory location. The code above means two Integer(1) object is created, of course two sides must point to different memory location.
Author And Source
この問題について(== operator for object in Java), 我々は、より多くの情報をここで見つけました https://qiita.com/saladlam/items/c867416f9b0db83b5e1d著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .