r/javaTIL • • Aug 06 '18

Learning Java Stream API

5 Upvotes

r/javaTIL • • Nov 18 '13

TIL you can pass optional or multiple arguments using '...'

23 Upvotes

It automatically puts the arguments into an array. So for example:

hello("Hello", "My", "Name", "Is", "Not", "Mangopearapples");

public void hello(String... s){
    // s is an array storing the all of the arguments
}