0

我正在eclipse中开发一个Android应用程序,我有这个if语句:

private static final int MAX_FREQ=2484;
private static final int MIN_FREQ=2412;

if ((freq >= MIN_FREQ) && (freq <= MAX_FREQ)){
        return true;     
    }

是 2462,由于freq某种奇怪的原因,它未能进入声明。当我将源更改为:

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;     
    }

这个有效... :-/ ? 我错过了什么?

4

1 回答 1

1

尝试这个:

    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;     
    }
于 2013-03-24T18:54:41.093 回答