Actually, because for compatibility reasons, the signature of a method, which is using varargs function(Object... args) is the equivalent of a method declared with an array function(Object[] args).

Therefore in order to pass and spread any collection to function which expects varargs, you need to transform it to the array:

import java.util.Arrays;
import java.util.stream.Stream;

public class MyClass {
  
  static void printMany(String ...elements) {
     Arrays.stream(elements).forEach(System.out::println);
  }
  
  public static void main(String[] args) {
    printMany("one", "two", "three");
    printMany(new String[]{"one", "two", "three"});
    printMany(Stream.of("one", "two", "three").toArray(String[]::new));
    printMany(Arrays.asList("foo", "bar", "baz").toArray(new String[3]));
  }
}

All these calls of printMany will print:

one

two

three

It's not exactly the same as spread operator, but in most cases, it's good enough.

Answer from Krzysztof Atłasik on Stack Overflow
🌐
Medium
medium.com › @bluethinkin › enhancing-enterprise-solutions-spread-operator-in-java-crm-sharepoint-integration-aef33c6c7991
Enhancing Enterprise Solutions: Spread Operator in Java & CRM-SharePoint Integration | by SEO BlueThinkIn | Medium
February 21, 2025 - While Java does not have a built-in spread operator like JavaScript, its functionality can be mimicked through modern techniques introduced in Java versions 8 and above.
🌐
GitHub
gist.github.com › ORESoftware › 3c4f25de70e9d1849572752c4b59d1a9
Varargs and spread operator in Java · GitHub
Varargs and spread operator in Java. GitHub Gist: instantly share code, notes, and snippets.
🌐
Coding Blocks Blog
blog.codingblocks.com › 2016 › the-3-dots-that-brings-a-bit-of-java-to-javascript
The 3 dots that brings a bit of Java to Javascript
December 9, 2018 - Now, with ECMAScript2015 (ES6) having been standardized, we have the spread and rest operators in Javascript, that does something similar, and even better it has support of varargs both in function definition, as well as function calls.
🌐
Oracle
docs.oracle.com › en › java › javase › 11 › docs › api › jdk.scripting.nashorn › jdk › nashorn › api › tree › SpreadTree.html
SpreadTree (Java SE 11 & JDK 11 )
January 20, 2026 - Nashorn JavaScript script engine and APIs, and the jjs tool are deprecated with the intent to remove them in a future release. A tree node for spread operator in array elements, function call arguments.
🌐
Baeldung
baeldung.com › home › java › core java › varargs in java
Varargs in Java | Baeldung
January 8, 2024 - A quick and practical introduction to varargs in Java.
Find elsewhere
🌐
Java Code Geeks
javacodegeeks.com › home › web development › javascript
Level Up Your JavaScript: Mastering the ES6 Spread Operator - Java Code Geeks
March 22, 2024 - Unleash the power of the ES6 Spread Operator! This guide takes you beyond the basics, revealing 5 advanced tricks to supercharge your JS.
🌐
GitHub
github.com › dart-lang › language › issues › 2278
Allow spread operator as parameters · Issue #2278 · dart-lang/language
June 6, 2022 - //java String text = 'Hi %s is your age %s? or %s?'; String.format(text, 'Alex', 30, 28); First of all, this is just an example of the usage, I think something like this makes understanding the idea. As evident the number of %s is variable it can be one or none. Under the hood, the format method makes use of spread operator on parameters like so:
Author   dart-lang
🌐
Iditect
iditect.com › faq › java › java-spread-operator.html
Java spread operator
In Java, there is no spread operator like you might find in some other programming languages (e.g., JavaScript).
🌐
DhiWise
dhiwise.com › post › the-kotlin-spread-operator-unfolding-arrays-into-arguments
Maximizing Efficiency with the Kotlin Spread Operator
June 6, 2024 - When the Kotlin spread operator is used in a function call, the compiler unwraps each element from the array and passes them into the function body as separate parameters. This process involves a bytecode-level operation that reconstructs the arguments into an array again because Java methods receive vararg arguments as arrays.
🌐
Medium
medium.com › @aayushid159 › java-varargs-vs-kotlin-varargs-spread-operator-in-kotlin-eb45b7a6f465
Java Varargs vs Kotlin Varargs & Spread Operator in Kotlin | by Aayushi | Medium
April 6, 2018 - In Java, you pass the array as is, whereas Kotlin requires you to explicitly unpack the array. Technically, this feature is called using a spread operator, but in practice it’s as simple as putting the * character before the corresponding argument:
🌐
LinkedIn
linkedin.com › posts › dipali-khalate-19a956202_spread-operator-in-java-script-thespread-activity-7003287979347611648-Yp5m
Dipali Khalate on LinkedIn: Spread Operator in java script. The spread (...) syntax allows an…
November 29, 2022 - The spread operator is used to unroll (to "spread", like Masala on Fish ) the individual elements of an iterate object or array (iterable collection), separated by a comma, into another collection.
🌐
Medium
alexanderkilroy.medium.com › java-in-a-nutshell-optionals-streams-api-83c90dcdc8ab
Java In A Nutshell — Optionals & Streams API | by Alexanderkilroy | Medium
January 7, 2022 - Before we jump into Streams, I just wanna’ make sure we’re aware of the ... operator as it’s used within the Streams API. It effectively allows us to spread a list of values, that aren’t actually a list or collection into a method, see the below:
🌐
HowToDoInJava
howtodoinjava.com › home › typescript › typescript / javascript spread operator
TypeScript / JavaScript Spread Operator (with Examples)
July 3, 2023 - The spread operator (in the form of ellipsis) can be used in two ways: Initializing arrays and objects from another array or object ... The spread operator is most widely used for method arguments in the form of rest parameters where more than ...
🌐
Coderanch
coderanch.com › t › 749149 › java › Variable-method-argument-list
Variable method argument list (Java in General forum at Coderanch)
January 21, 2022 - Stephan van Hulst wrote:It appears like you're looking for the spread operator. Yeah, that sounds promising. I don't have a use for it now, but I'll file it away for next time! Thanks! The problem with getting rid of the "undesirables" is that sooner or later someone will decide that YOU are an undesirable. ... Hahaha sorry for pulling your leg. It's Saturday and I'm feeling in a silly mood. While "spread syntax" really is a thing, it's not in Java.
🌐
Medium
yahjairav.medium.com › spread-operator-whats-with-the-thing-9aa685bc9db5
Spread Operator: Whats With The “…” Thing? | by Yahjaira Vasquez | Medium
May 14, 2020 - Let us start with a basic array. We can use the spread operator, within square brackets, to embed the contents of that previous array with the new array being created. At this point we can proceed to add additional content to the array as shown above. It is pretty straight forward.