title: What will public static int[] main (int[] ) return and where?
body: <pre><code>class Half  {
      public int evaluate(int arg) {
          return arg/2;
      }
  }
  
  public class Box {
  
       public static int [] main (int[] arrIn) {
  
          int[] arrOut = new int[arrIn.length];
          Half func = new Half();
  
          for (int i=0; i&lt; arrIn.length; i++)
              arrOut[i] = func.evaluate(arrIn[i]);
          return arrOut;
  }
  }
  </code></pre>
  
  <p>So contents of arrOut are the elements in arrIn divided by two.
  I want to take integer array from command line arguments and print array with new contents to screen.(I don't want to take it as string values then convert to int and blah blah)
  Is there any way to take direct integers as arguments?</p>
  
  <p>Secondly the above code gives an error.(Obviously)</p>
  
  <pre><code>Error: Main method not found in class Box, please define the main method as:
     public static void main(String[] args)
  </code></pre>
  
  <p>Which brings me to my next question. </p>
  
  <p>Should it always be <code>public static void main(String[] args)</code>? Can't it be public static int main with some arguments other than string type?(Don't explain the static part.. As per my understanding main method needs to be invoked without an object which is why it is static. but if it is forced(somehow) to return an integer, where will it return it?(I mean to which method? or will it directly print to the screen?)I know it doesn't print to the screen (duh!) but then where is the control returned basically after main method finishes execution?</p>