I want to store 1 to 110 in string array variable, when i tried am getting null pointer exception.
String age[];
for(int i=0;i<=101;i++){
age[i]=Integer.toString(i);
}
开发者_运维百科
You'll need to initialize the String-array first:
String[] age = new String[110];
try this:
String[] age = new String[102];
String.valueOf(int value);
String abc = String.valueOf(int);
You have to create the String array first:
String[] age = new String[111];
You got error because you haven't initialized it :
String[] age = new String[111];
精彩评论