LoserAndFailure
Programmer
Here is the fragment of code that the compiler keeps fussing about:
private int firstEmptyElement()
{
int i;
for (i=0; i<asciiRange.length; i++)
{
if (asciiRange = 0)
break;
}
return i;
}
And here is the error msg I get:
C:\jdk1.2.1\bin>javac PwGenerator.java
PwGenerator.java:152: Incompatible type for if. Can't convert int to boolean.
if (asciiRange = 0)
^
1 error
I'm like, "Excuse me???? I'm just checking to see if a certain value is zero or not and it's fussing at me about freakin' conversions from int to boolean?????" Why am I getting this error? I tried doing if(asciiRange = null), but I got an additional error. Your help will be greatly appreciated by this novice.
Baffled in the USA
private int firstEmptyElement()
{
int i;
for (i=0; i<asciiRange.length; i++)
{
if (asciiRange = 0)
break;
}
return i;
}
And here is the error msg I get:
C:\jdk1.2.1\bin>javac PwGenerator.java
PwGenerator.java:152: Incompatible type for if. Can't convert int to boolean.
if (asciiRange = 0)
^
1 error
I'm like, "Excuse me???? I'm just checking to see if a certain value is zero or not and it's fussing at me about freakin' conversions from int to boolean?????" Why am I getting this error? I tried doing if(asciiRange = null), but I got an additional error. Your help will be greatly appreciated by this novice.
Baffled in the USA