Weird int situation

I'm new to this forum and AP java the extent of my java knowledge, so forgive me if this is something common in java. I'm working on an project for school in which I am taking an existing Chess program, taking out most of the pieces and empty squares, and then trying to make a game tree for this simplified version of Chess. This idea may not work, and it is perfectly fine if it doesn't. However, I have for the most part finished my editing and the program has a number of issues that prevent me from getting either a positive or negative result.

The most pressing of this issues has really got me puzzled. If you need to see the code in its entirety just ask, but to try to avoid getting into the bloody details of the code I'll post this short if statement:

if(status==DRAW && status==STALEMATE && status==50);{

bigState = ("Something is fishy");

}

now status is an int, DRAW=2, and STALEMATE=4. So this if statement is essentially saying, "If this int somehow equals 3 numbers, set this string to.."

And when I run the code with a System.out.println(bigState), sure enough it reads "Something is fishy." And by the way, at no point in the code can status even be set to 50.

Have I invertantly found a mathematical anomaly or is this a known issue in Java?

[1331 byte] By [timjamesa] at [2007-10-2 13:23:37]
# 1

Reads to me like a typo .. that the && should be ||. As written,

unless Draw == Status == 50, you'll never get into that if statement.

Ah, very sneaky. There's also a ; after the ). Technically that code

doesn't execute in the body of the if statement. The bigState

assignment will always happen. The if block does nothing.

if (status==DRAW && status==STALEMATE && status==50);

{

bigState = ("Something is fishy");

}

es5f2000a at 2007-7-13 11:01:53 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 2

> if(status==DRAW && status==STALEMATE &&

> status==50);{

>bigState = ("Something is fishy");

>}

>

Usually, when you think there's a problem in a language and not in your code, you have to go back 5-6 times and check your code. Then, if you don't find your problem, you have to go back 5-6 times and check your code.

This line will probably behave correctly if your remove the semicolon after status==50)

atmguya at 2007-7-13 11:01:53 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...