0
I need an help on String ... string
7 Answers
0
here:
help
String ... string
+ 3
Keywords like for,return and if should be lower case
0
I have a function public int defineStocks(String . . . stocks){
...//body
}
0
I do for(String d : stocks) but i receive a nullpointerexception when i try to do stock[j] = d
0
Public int defineStocks(String ... stocks){
Int rightTransiction =0;
For (String d : stocks){
For(int j =0; j<i; j++){/*i Is a public variabile in public classe*/
If(stock[j]==d)
Return rightTransiction;
}
stock[i]=d;//here i have the nullpointerexception
i++;
rightTransition++;
}
Return rightTransition;
}
0
I know they are lowercase on the Pc i writer it on the phone
0
Did you initialize stock?
If you have something like this:
static String[] stock;
you will get NullPointerException :