This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
jacob deiter wrote:In Read some article ,it says that if two Objects (EX: String ) has the same value then it refer to same memory location.
I'd like to see a link to that article, because as a general statement, it is false. It is true however, that if Strings have the same value, they can often refer to the same object which is located in the String pool, but there's no guarantee for this. It is best to compare Strings for equality using the equals or equalIgnoreCase methods.