hi
I came up with this code to help me convert a string into an integer array but i keep getting a null exception when i run it and i am not sure how to fix it.
import java.io.*;
import java.lang.reflect.Array;
public class test {
static String message;
static int[] arr;
static int j;
static String[] arr2;
public static void main(String[] args) {
message = "123456";
arr2 = new String [] {message};
j = message.length();
for (int i=0; i<=arr2.length; i++){
arr[i] = Integer.parseInt(arr2[i]);
}
System.out.println(arr[1]);
System.out.println(arr[2]);
}
}
Thanks