Why can't we just use arrays instead of varargs?
I just came across varargs while learning android( doInBackground(Type... params) ) , SO posts clarified the use of it My question is why can't we just use Arrays instead of varargs public void foo(String...strings) { } I can replace this type of a call by packing my variable number of arguments in an array and passing it to a method such as this public void foo(String[] alternativeWay){ } Also does main(String[] args) in java use varargs , if not how are we able to pass runtime parameters to it Please suggest the benefits or use of varargs and is there there anything else important to know