Strange if, if else execution
Posted on 2007-11-29
I'm not sure why this if/else statement is skipping over my first case. I have a string with the contents:
then the code that checks it:
if (strCode == "nearestneighbor")
m_ImageQuality = RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR;
else if (strCode == "bilinear")
m_ImageQuality = RenderingHints.VALUE_INTERPOLATION_BILINEAR;
else if (strCode == "bicubic")
m_ImageQuality = RenderingHints.VALUE_INTERPOLATION_BICUBIC;
System.out.println("The value of strCode was [" + strCode + "].");
Now it doesn't enter the first if block, which I think it should. The print out at the end of the cases verifies the contents, here's what's printed out:
The value of strCode was [nearestneighbor].
I must be missing something really silly, why is it not matching?