I defined a Double instance variable like this:
public class CurrencyActivity extends Activity {
private Button convertBtn;
private Double SEKrate;
....
public void convertCurrency() {
....
Double inputNum = Double.parseDouble(editTextStr);
Double result = inputNum*SEKrate;
....
}
....
}
When running, it says NullPointer exception at the line
Double result = inputNum*SEKrate;
It seems like SEKrate is initialized to null, but autoboxing is not performed here. any thought on this?