What is the difference between main String args and main String args in Java

0 votes
What is the difference between public static void main(String[] args) and public static void main(String... args) in Java?
Sep 6, 2019 in Java by anonymous
4,806 views

1 answer to this question.

0 votes

String[] is used to accept a single parameter whereas String ... is used to accept an array of parameters. 

String ... is equivalent to String[] is only one parameter is passed to String ... but it allows you to pass multiple parameters.

But when you use String[], you can only use one parameter, you can not pass more than one parameters. 

answered Sep 6, 2019 by Piya

Related Questions In Java

0 votes
2 answers

What is the difference between Set and List in java?

List is an ordered sequence of elements. ...READ MORE

answered Apr 26, 2018 in Java by Akrati
• 3,190 points
64,660 views