varags. If a method signature is method(Param param, String... x) it will take one Param type of object and any number of String objects.

There are couple if cool things about it:

  1. It's nothing special. It's just sugared array. So, method(MyObject... o) is same as method(MyObject[] o).

  2. Vararg has to be the last parameter in argument list.

  3. There is this funny thing that bit me once. method(MyObject... o) can be called as method() without any compilation error. Java will internally convert the no-arg call to method(new MyObject[0]). So, be aware of this.

Answer from Nishant on Stack Overflow
🌐
W3Schools
w3schools.com › java › java_strings.asp
Java Strings
Java Wrapper Classes Java Generics Java Annotations Java RegEx Java Threads Java Lambda Java Advanced Sorting ... How Tos Add Two Numbers Swap Two Variables Even or Odd Number Reverse a Number Positive or Negative Square Root Area of Rectangle Celsius to Fahrenheit Sum of Digits Check Armstrong Num Random Number Count Words Count Vowels in a String Remove Vowels Count Digits in a String Reverse a String Palindrome Check Check Anagram Convert String to Array Remove Whitespace Count Character Frequency Sum of Array Elements Find Array Average Sort an Array Find Smallest Element Find Largest Element Second Largest Array Min and Max Array Merge Two Arrays Remove Duplicates Find Duplicates Shuffle an Array Factorial of a Number Fibonacci Sequence Find GCD Check Prime Number ArrayList Loop HashMap Loop Loop Through an Enum
🌐
GeeksforGeeks
geeksforgeeks.org › java › strings-in-java
Java Strings - GeeksforGeeks
Syntax: // Method 1 String str= "geeks"; // Method 2 String str= new String("geeks"); StringBuffer is a peer class of String, it is mutable in nature and it is thread safe class , we can use it when we have multi threaded environment and shared ...
Published   January 13, 2026
Discussions

android - What is "String..." in java? - Stack Overflow
Possible Duplicate: varargs and the '…' argument Java, 3 dots in parameters I saw this definition in my android java file. It looks just like String[]. Are they different? Than... More on stackoverflow.com
🌐 stackoverflow.com
String templates: syntax question
I am in the minority in actually liking the syntax for many of the reasons Brian listed. I do a lot of code generation and even have a templating language kind of designed for it: https://github.com/jstachio/jstachio Let me tell you guys... ${x} is shitty syntax for making templates that generate code especially Java code. ${..} has a substantial amount of collision. It is actually sort of why I use Mustache for generating code is because you can change the delimiters as {{x}} is still confusing with Java code. Anyway I expect to be downvoted to oblivion but I know they JDK team made the right choice on this one. More on reddit.com
🌐 r/java
35
33
July 31, 2023
It looks like JDK20 is getting a String Templates preview!
While I’m not that happy about the \{} syntax, it’s really cool that Java will finally have this. More on reddit.com
🌐 r/java
82
147
June 26, 2022
Array type annotation syntax: String[] -vs- [String]
I prefer Array[String]. [] should not just be array syntax, but generics in general. There's no reason to give array a special treatment. You should be able to replace Array with List or something else and not have to change any other part of the syntax. In Haskell [ ] is a list, and lists are given special treatment. They're linked lists and often not what you want anyway. All of Haskell's standard prelude gives lists a special treatment which is part of why there have been attempts to replace it with a better prelude. For example, functions like map are specific to lists, which is why the generic version, Functor, has to name it's map fmap because map is already taken. But since lists are functors, you can replace any instance of map with fmap and nothing will change. Obvious here that map would be better in the functor to begin with, and lists don't deserve the special treatment. Lists should instead be written the same as any other type in Haskell, for consistency. data List a = Nil | Cons a (List a) class Functor f where map :: f a -> (a -> b) -> f b instance Functor List where map :: List a -> (a -> b) -> List b = ... Pretty sure most Haskellers would agree. The reason it's this way is because Haskell's lists pre-date the introduction of typeclasses to the language. More on reddit.com
🌐 r/ProgrammingLanguages
57
45
July 13, 2022
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › lang › String.html
String (Java Platform SE 8 )
October 20, 2025 - The class String includes methods for examining individual characters of the sequence, for comparing strings, for searching strings, for extracting substrings, and for creating a copy of a string with all characters translated to uppercase or to lowercase. Case mapping is based on the Unicode Standard version specified by the Character class. The Java language provides special support for the string concatenation operator ( + ), and for conversion of other objects to strings.
🌐
Programiz
programiz.com › java-programming › string
Java String (With Examples)
In Java, a string is a sequence of characters. For example, "hello" is a string containing a sequence of characters 'h', 'e', 'l', 'l', and 'o'. In this tutorial, we will learn about strings in Java with the help of examples.
🌐
Oracle
docs.oracle.com › javase › tutorial › java › data › strings.html
Strings (The Java™ Tutorials > Learning the Java Language > Numbers and Strings)
For each object that is not a String, its toString() method is called to convert it to a String. Note: The Java programming language does not permit literal strings to span lines in source files, so you must use the + concatenation operator at the end of each line in a multi-line string.
Find elsewhere
🌐
Edureka
edureka.co › blog › java-string
Java Strings - How to Declare String in Java With Examples
February 13, 2025 - For Example: String s=“Welcome”; By new keyword : Java String is created by using a keyword “new”. For example: String s=new String(“Welcome”); It creates two objects (in String pool and in heap) and one reference variable where ...
🌐
TheServerSide
theserverside.com › definition › Java-string
What Is a Java String?
Java strings are created and manipulated through the string class. Once created, a string is immutable -- its value cannot be changed. A string is sequence of characters. A class is a user-defined template for creating an object. A string class is a user-defined template for creating and manipulating string objects, which are sequences of characters. Methods of class string enable the following capabilities: ... Below is one simple syntax for creating a Java string.
🌐
Tutorialspoint
tutorialspoint.com › home › java › java strings
Java Strings
September 1, 2008 - Learn about Java Strings, their methods, and how to manipulate text in Java programming. Explore examples and best practices for effective string handling.
🌐
W3Schools
w3schools.com › java › java_ref_string.asp
Java String Reference
Java Wrapper Classes Java Generics Java Annotations Java RegEx Java Threads Java Lambda Java Advanced Sorting ... How Tos Add Two Numbers Swap Two Variables Even or Odd Number Reverse a Number Positive or Negative Square Root Area of Rectangle Celsius to Fahrenheit Sum of Digits Check Armstrong Num Random Number Count Words Count Vowels in a String Remove Vowels Count Digits in a String Reverse a String Palindrome Check Check Anagram Convert String to Array Remove Whitespace Count Character Frequency Sum of Array Elements Find Array Average Sort an Array Find Smallest Element Find Largest Element Second Largest Array Min and Max Array Merge Two Arrays Remove Duplicates Find Duplicates Shuffle an Array Factorial of a Number Fibonacci Sequence Find GCD Check Prime Number ArrayList Loop HashMap Loop Loop Through an Enum
🌐
Oracle
docs.oracle.com › javase › 7 › docs › api › java › lang › String.html
String (Java Platform SE 7 )
The class String includes methods for examining individual characters of the sequence, for comparing strings, for searching strings, for extracting substrings, and for creating a copy of a string with all characters translated to uppercase or to lowercase. Case mapping is based on the Unicode Standard version specified by the Character class. The Java language provides special support for the string concatenation operator ( + ), and for conversion of other objects to strings.
🌐
GeeksforGeeks
geeksforgeeks.org › java › string-class-in-java
String Class in Java - GeeksforGeeks
November 12, 2025 - The String class in Java is used to create and manipulate sequences of characters. It is one of the most commonly used classes in Java.
🌐
IONOS
ionos.com › digital guide › websites › web development › java strings
How to use Java strings - IONOS
January 6, 2025 - equals() is one of many methods you can use to compare Java strings with each other. The method returns a Boolean value (true or false). Here is its syntax:
🌐
Scaler
scaler.com › topics › java › string-in-java
String in Java (With Examples) - Scaler Topics
June 20, 2022 - Syntax: Example : Output: Exception Example: Output: Explanation: In the above-given example, when we passed 14 as an argument index number, we got StringIndexOutOfBoundsException. It is because the length of the string = 14, hence highest index in the string is 13. Details: What if we want to concat(or connect) two strings? We have a method for that too! The concat() method of string in Java is used for concatenating two strings.
🌐
Simplilearn
simplilearn.com › home › resources › software development › java tutorial for beginners › what are java strings and how to implement them?
What are Java Strings and How To Implement Them
July 23, 2024 - What are Java strings and how do you create them? Learn all about Java strings, the methods based on Java strings, sub strings, and more with example programs.
Address   5851 Legacy Circle, 6th Floor, Plano, TX 75024 United States
🌐
Quora
quora.com › What-is-string-in-Java-3
What is string in Java? - Quora
Answer (1 of 5): It is a data type that stores values in text format. It is assigned to a variable to tell the compiler that this variable will store data in text format. That variable is then called a string variable. These concepts are followed in strongly typed languages (where variables stron...
🌐
Codedamn
codedamn.com › news › java
Strings in Java Explained (with Examples)
February 8, 2023 - As with any other programming language Java also has a character sequence data type that is known as String, but a string in Java is class-based and can work as a data type too. I have shown in the introduction how we can initialise a string in Java with the code demonstration.
🌐
ScholarHat
scholarhat.com › home
What is String in Java - Java String Methods & Type (Examples)
Creating a String from a Subsequence: String ob3 = new String(arr, 1, 2); creates a String using a part of the character array (from index 1 to 2) and prints it as "Contents of subsequence of Array String: ka".
Published   August 30, 2025
🌐
DigitalOcean
digitalocean.com › community › tutorials › java-string
Java String | DigitalOcean
August 3, 2022 - Let’s have a look at some of the popular String class methods with an example program. Java String split() method is used to split the string using given expression.