i got an error when i run this code!
private class ValuesClass {
List<Float> value;
public void addv(String _value) {
Float f = new Float(_value);
this.value.add(f);
}
}
This is the error returned
0.83
0.83
Exception in thread "main" java.lang.NullPointerException
at com.gsware.gsmarketanalyzer.StockQuote$ValuesClass.addv(StockQuote.java:216)
I don’t know where is the error!
You have to instantiate the list, otherwise
valueis null: