(String ...) is an array of parameters of type String, where as String[] is a single parameter.

Now here String[] can full fill the same purpose here but (String ...) provides more readability and easiness to use.

It also provides an option that we can pass multiple array of String rather than a single one using String[].

Answer from FaizanHussainRabbani on Stack Exchange
🌐
Scaler
scaler.com › home › topics › what is string args[ ] in java?
What is String args[] in Java? - Scaler Topics
May 21, 2024 - String[] args is an array of a sequence of strings that are passed to the main function. Learn more String args array on Scaler Topics.
🌐
Medium
medium.com › @VictoriousAura › oh-whats-this-in-public-static-void-main-string-args-in-java-d22318fc5455
Oh! Whats this ‘…’ in public static void main(String … args) in Java? | by Shrreya Behll | Medium
January 13, 2019 - Varargs or Variadic function in Java was introduced as a language feature in J2SE 5.0. The argument of the method can be declared as a variable arity parameter or simply varargs method.
🌐
DigitalOcean
digitalocean.com › community › tutorials › public-static-void-main-string-args-java-main-method
Understanding public static void main(String[] args) in Java | DigitalOcean
June 26, 2025 - Learn what public static void main(String[] args) means in Java. Understand each keyword’s purpose and how the main method powers Java programs.
🌐
Blogger
javarevisited.blogspot.com › 2013 › 04 › what-is-string-args-in-java-main-method.html
What is String args[] Argument in Java Main method? Example
When we start a Java program, JVM loads class with main method and pass String array, which contains arguments from command line. You can use this string array to control behavior of your Java program by passing arguments.
🌐
Coderanch
coderanch.com › t › 779973 › java › Understanding-main-method-String-args
Understanding the main method and String[] args (Beginning Java forum at Coderanch)
February 27, 2024 - There is a convention in Java that the JVM would start a Java program by searching for and calling a method with the following signature: public static void main( String[] args ) The language designers could have called this anything they wanted but this is what they came up and we have to follow the convention.
Find elsewhere
🌐
Quora
quora.com › What-does-the-String-args-in-a-Java-main-method-actually-mean
What does the 'String[ ] args' in a Java main method actually mean? - Quora
Answer (1 of 21): String[] args in Java is an array of strings which stores arguments passed by command line while starting a program. All the command line arguments are stored in that array. Following example will clear your doubt: [code]public class Test { public static void main(String[] ...
Top answer
1 of 8
21

Update: I just realized I never answered the question "What does “String[] args” contain in java?" :-) It's an array of the command-line arguments provided to the program, each argument being a String in the array.

And we now resume with our regularly-scheduled answer...

args is an array. To see individual command-line arguments, index into the array — args[0], args[1], etc.:

You can loop through the args like this:

public class Test
{
    public static void main(String[] args)
    {
        int index;

        for (index = 0; index < args.length; ++index)
        {
            System.out.println("args[" + index + "]: " + args[index]);
        }
    }
}

For java Test one two three, that will output:

args[0]: one
args[1]: two
args[2]: three

Or loop like this if you don't need the index:

public class Test
{
    public static void main(String[] args)
    {
        for (String s : args)
        {
            System.out.println(s);
        }
    }
}

So, what does "[Ljava.lang.String;@153c375" mean?

That's Java's default toString return value for String[] (an array of String). See Object#toString. The [ means "array", the L means "class or interface", and java.lang.String is self-explanatory. That part comes from Class#getName(). The ;@153c375 is ;@ followed by the hashCode of the array as a hex string. (I think the default implementation of hashCode for Object indicates where in memory the array is located, which is why it's different for different invocations of your program, but that's unspecified behavior and wouldn't be any use to you anyway.)

2 of 8
8

String[] args in main method is the String array of the command line arguments.

[Ljava.lang.String;@1d1e730 are the class name ([Ljava.lang.String is String[]) and the object's hashcode (@1d1e730);

if you want to print the actual values of the Strings in the array, you can use a simple for-each loop:

for(String arg:args)
    System.out.println(arg);
🌐
YouTube
youtube.com › watch
public static void main(String args) In Java - What is String args? - YouTube
$1,500 OFF ANY Springboard Tech Bootcamps with my code ALEXLEE1500. See if you qualify for the JOB GUARANTEE! 👉 https://bit.ly/3HX970hIn this video, I show ...
Published: June 1, 2023
🌐
Emory
mathcs.emory.edu › ~cheung › Courses › 170 › Syllabus › 09 › command-args.html
Emory
Using command arguments: a simple addition program --- part 1 · Problem description: We use the · running sum algorithm (see: click here ) Pseudo code: Java program: a · failed attempt · Question: Example Program: (Demo above code) &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp ...
🌐
GeeksforGeeks
geeksforgeeks.org › java › java-main-method-public-static-void-main-string-args
Java main() Method - public static void main(String[] args) - GeeksforGeeks
August 17, 2026 - ... public class Main { public static void main(String[] args) { if (args.length == 0) { System.out.println("Running main() with no arguments"); } else if (args.length == 1) { try { int value = Integer.parseInt(args[0]); main(value); } catch ...
🌐
javaspring
javaspring.net › blog › java-string-args
Understanding Java String Args — javaspring.net
In Java programming, the `String[] args` parameter is a fundamental concept that plays a crucial role when it comes to passing command-line arguments to a Java application. When you run a Java program from the command line, you can provide additional data to the program, and these data are received by the `main` method through the `String[] args` parameter.
🌐
GeeksforGeeks
geeksforgeeks.org › java › command-line-arguments-in-java
Command Line Arguments in Java - GeeksforGeeks
Command-line arguments in Java are space-separated values passed to the main(String[] args) method.
Published: September 28, 2026
🌐
javathinking
javathinking.com › blog › what-is-the-string-args-parameter-in-the-main-method
What is String args[] in Java's main method? Explained with Examples & Usage — javathinking.com
... static: Can be called without creating an object of the class (the JVM doesn’t instantiate the class to run main()). ... String[] args: The parameter we’ll focus on—an array of String objects.
🌐
Codemia
codemia.io › home › knowledge hub › what is the string args[] parameter in the main method?
What is the String args[] parameter in the main method? | Codemia
January 26, 2025 - In Java programming, the main method, often declared as public static void main(String[] args), plays a crucial role as the entry point for any standalone Java application.
🌐
Emory
cs.emory.edu › ~cheung › Courses › 170 › Syllabus › 09 › command-args.html
The command line arguments of a Java program
Using command arguments: a simple addition program --- part 1 · Problem description: We use the · running sum algorithm (see: click here ) Pseudo code: Java program: a · failed attempt · Question: Example Program: (Demo above code) &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp ...