Solved Java if statement error

July 8, 2012 at 17:59:10
Specs: Windows XP
whenever i use the IF function in my IDE,
it gives me an error saying incompatible types: int, boolean.

if ( a = 2 )
{
a = 1
}

what is wrong with my script??


See More: Java if statement error

Report •


#1
July 8, 2012 at 18:30:16
✔ Best Answer
A single equals sign is assignment. A double equals sign is an equality test. You're specifying the former, you want the latter.

How To Ask Questions The Smart Way


Report •
Related Solutions


Ask Question