title: How to convert the numeric comma separated string into int array
body: <pre><code>    //convert the comma separated numeric string into the  array of int. 
      public class HelloWorld
      {
        public static void main(String[] args)
        {
         // line is the input  which have the comma separated number
          String line = "1,2,3,1,2,2,1,2,3,";
         // 1 &gt; split   
           String[] inputNumber =  line.split(",");
         // 1.1 &gt; declare int array
           int number []= new int[10];
         // 2 &gt; convert the String into  int  and save it in int array.
           for(int i=0; i&lt;inputNumber.length;i++){
                 number[i]=Integer.parseInt(inputNumber[i]);
           }
      }
  }
  </code></pre>
  
  <p>Is it their any better solution of doing it. please suggest or it is the only best solution of doing it. </p>
  
  <p>My main aim of this question is to find the best solution.</p>