title: can we change the main method of java?
body: <p>Main method in Java have the <strong>String[]</strong> as input parameter to the main method, but i want to pass <strong>object</strong> as a parameter. Java and all command line parametrized languages accept only String array of arguments which make sense as our ability to call using command line gives us the ability to enter text that could be represented by <strong>String object</strong> in Java</p>
  
  <p>This is how we used to have a method like:</p>
  
  <pre><code>public static void main (String[] args) {
  
  for (String text: args) {
  System.out.println(text);
  }
  }
  </code></pre>
  
  <p>If we need to pass <strong>integer</strong> value, we need to use <strong>parsing</strong>
   method to obtain the numeric value from it.</p>
  
  <pre><code> try {
   Arg = Integer.parseInt(args[0]);
   } catch (NumberFormatException e) {
   System.err.println("Number format mismatch");
   }
  </code></pre>
  
  <p>What if we need to pass a whole object as an argument to the class?</p>
  
  <p>Regards</p>