I'm getting a string array from command line and displaying it to user as integer array. What could be the mistake here?
import java.lang.String;
public class arrayConvert {
String strArray[];
public int[] StrArrtoIntArr(String strArray[])
{
int intArray[] = new int[strArray.length];
for(int count=0;count<strArray.length;count++)
{
intArray[count] = Integer.parseInt(strArray[count]);
}
return intArray;
}
public void displayArray(int intArray [])
{
for(int j=0;j<intArray.length; j++)
{
System.out.println(intArray[j]);
}
}
public static void main(String[] args)
{
arrayConvert array_convert = new arrayConvert();
array_convert.StrArrtoIntArr(args);
array_convert.displayArray(intArray);
}
}