DJ_AM_Juicebox
asked on
Strange if, if else execution
Hi,
I'm not sure why this if/else statement is skipping over my first case. I have a string with the contents:
"nearestneighbor"
then the code that checks it:
if (strCode == "nearestneighbor")
{
System.out.println("using nn");
m_ImageQuality = RenderingHints.VALUE_INTER POLATION_N EAREST_NEI GHBOR;
}
else if (strCode == "bilinear")
{
System.out.println("using bilinear");
m_ImageQuality = RenderingHints.VALUE_INTER POLATION_B ILINEAR;
}
else if (strCode == "bicubic")
{
System.out.println("using bicubic");
m_ImageQuality = RenderingHints.VALUE_INTER POLATION_B ICUBIC;
}
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?
Thanks
I'm not sure why this if/else statement is skipping over my first case. I have a string with the contents:
"nearestneighbor"
then the code that checks it:
if (strCode == "nearestneighbor")
{
System.out.println("using nn");
m_ImageQuality = RenderingHints.VALUE_INTER
}
else if (strCode == "bilinear")
{
System.out.println("using bilinear");
m_ImageQuality = RenderingHints.VALUE_INTER
}
else if (strCode == "bicubic")
{
System.out.println("using bicubic");
m_ImageQuality = RenderingHints.VALUE_INTER
}
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?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.