I am developing an Android App in eclipse and I have this if statement:
private static final int MAX_FREQ=2484;
private static final int MIN_FREQ=2412;
if ((freq >= MIN_FREQ) && (freq <= MAX_FREQ)){
return true;
}
The freq is 2462 and for some odd reason it fails to get into the statement. When I change the source into:
private static final int MAX_FREQ=2484;
private static final int MIN_FREQ=2412;
if ((freq >= MIN_FREQ) && (freq <= MAX_FREQ)){
Log.e(TAG,""Bla Bla");
return true;
}
this one works ... :-/ ? What am I missing ?
1 Answer 1
Try this:
private static final int MAX_FREQ=2484;
private static final int MIN_FREQ=2412;
if ((freq >= MIN_FREQ) && (freq <= MAX_FREQ)) //missing (
{
Log.e(TAG,"Bla Bla"); //Semicolon missing in your code and two " signs together
return true;
}
Sign up to request clarification or add additional context in comments.
Comments
lang-java
(