This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Need help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Need help" Watch "Need help" New topic
Author

Need help

kevin jia
Ranch Hand

Joined: Jul 13, 2000
Posts: 38
Hi,gurus
Could anyone explain , why the answer for following question is false.
public class Q9 {
public static void main(String[] args) {
Byte b1 = new Byte("127");
if(b1.toString() == b1.toString()) {
System.out.println("True");
} else {
System.out.println("False");
}
}
}
thanks !
Ajith Kallambella
Sheriff

Joined: Mar 17, 2000
Posts: 5782
Read the exact same discussion here and here!
Ajith


Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
kevin jia
Ranch Hand

Joined: Jul 13, 2000
Posts: 38
thanks Ajith.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need help
 
Similar Threads
Interesting Question
comparison
* Byte == comparision
toString( ) method
strange results