If we run a Java Program by writing the command “java Hello Geeks At GeeksForGeeks” where the name of the class is “Hello”, then it will run upto Hello. It is command upto “Hello” and after that i.e “Geeks At GeeksForGeeks”, these are command line arguments.
When command line arguments are supplied to JVM, JVM wraps these and supply to args. It can be confirmed that they are actually wrapped up in args array by checking the length of args using args.length
This article is contributed by Twinkle Tyagi. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- Scanner Class in Java
- Ways to read input from console in Java
- How to create Immutable class in Java?
- Method overloading and null error in Java
- Scanner and nextChar() in Java
- HashSet vs TreeSet in Java
- ShortBuffer allocate() method in Java With Examples
- IntBuffer duplicate() method in Java with Examples
- ShortBuffer compact() method in Java With Examples
- LongBuffer equals() method in Java