This week's book giveaway is in the Testing forum. We're giving away four copies of The Way of the Web Tester: A Beginner's Guide to Automating Tests and have Jonathan Rasmusson on-line! See this thread for details.
JVM has constant pool of string objects.that's why "Java"=="Java" always evaluates to true. is the same case with wrapper objects? Integer i=3; Integer j=3; i==j ?
posted 9 years ago
Not for all values.
This is from the Java Language Specification, 5.1.7.
If the value p being boxed is true, false, a byte, a char in the range \u0000 to \u007f, or an int or short number between -128 and 127, then let r1 and r2 be the results of any two boxing conversions of p. It is always the case that r1 == r2.