Need to figure out what is the difference between ... and arrays in JAVA, also an array list.
It seems we can use both as unlimited, but ... is rarely used.
Really appreciate any help you can.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The three dots can only be used in a method argument, and are called ‘varargs’. It means you can pass in an array of parameters without explicitly creating the array.
private void method(String[] args) {}is called likemethod(new String[]{"first", "second"});private void method(String... args) {}is called likemethod("first", "second");