Sunday, June 3, 2007

Question for Java programmers...

Does anyone know how I can get the if statement to be true?

I have this:

String in = new String("INCLUDE");
if( in.toString() == "INCLUDE" )
System.out.println("Got me a P3 700!");
else
System.out.println("Got me a AMD t-bird!");


For some reason the condition in the if statement is false and it prints AMD t-bird instead of P3 700... I'm befuddled. Thanks

Mavi forum

0 comments: