In public static void main(String args), all the command line arguments were taken in args. like: java somefile abc xyz Here args=abc args=xyz But public static void main(String s1) is a normal static method. How come both will be the same....? I mean args is an array and args is a single String obj variable. Did I answer your question?? [ May 09, 2008: Message edited by: K Kiran Kumar ]
It is still true that multiple arguments must be passed in an array, but the varargs feature automates and hides the process.
So, the compiler behind the scenes actually converts your var args method to a method with an array input. This is the reason why you can have a var args method overloaded with an array as input because after compilation both of them will be identical.