Title: Command Line Arguments in Java - GeeksforGeeks
Open Graph Title: Command Line Arguments in Java - GeeksforGeeks
Description: Your All-in-One Learning Portal. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
Open Graph Description: Your All-in-One Learning Portal: GeeksforGeeks is a comprehensive educational platform that empowers learners across domains-spanning computer science and programming, school education, upskilling, commerce, software tools, competitive exams, and more.
Keywords:
Opengraph URL: https://www.geeksforgeeks.org/java/command-line-arguments-in-java/
Domain: www.geeksforgeeks.org
{"@context":"https://schema.org","@type":"Article","mainEntityOfPage":{"@type":"WebPage","id":"https://www.geeksforgeeks.org/java/command-line-arguments-in-java/"},"headline":"Command Line Arguments in Java","datePublished":"2016-08-16 07:37:33","dateModified":"2026-05-28 12:22:57","image":[{"@type":"ImageObject","url":"https://media.geeksforgeeks.org/wp-content/uploads/20241227111123375183/cmd.png","width":"851","height":"268"},{"@type":"ImageObject","url":"https://media.geeksforgeeks.org/wp-content/cdn-uploads/output-1.png","width":"649","height":"167"}],"author":{"@type":"Organization","name":"GeeksforGeeks","url":"https://www.geeksforgeeks.org/","logo":{"@type":"ImageObject","url":"https://media.geeksforgeeks.org/wp-content/cdn-uploads/logo-new-2.svg","width":"301","height":"40"}},"publisher":{"@type":"Organization","name":"GeeksforGeeks","url":"https://www.geeksforgeeks.org/","logo":{"@type":"ImageObject","url":"https://media.geeksforgeeks.org/wp-content/cdn-uploads/logo-new-2.svg","width":"301","height":"40"}},"description":"Command-line arguments in Java are values passed to a program during execution through the command prompt. These arguments are stored as String values in the main() method parameter.Used to provide input without hardcoding values in the program.Helps make programs flexible and reusable for different inputs.Commonly used for file names, configuration","about":[{"@type":"Thing","name":"Java"},{"@type":"Thing","name":"JavaBasics"}]}
{"@context":"https://schema.org","@type":"WebSite","name":"GeeksforGeeks","url":"https://www.geeksforgeeks.org/","potentialAction":{"@type":"SearchAction","target":"https://www.geeksforgeeks.org/search/{search_term_string}/","query-input":"required name=search_term_string"}}
{"@context":"https://schema.org","@type":"Organization","name":"GeeksforGeeks","url":"https://www.geeksforgeeks.org/","logo":"https://media.geeksforgeeks.org/wp-content/cdn-uploads/20200817185016/gfg_complete_logo_2x-min.png","description":"Your All-in-One Learning Portal: GeeksforGeeks is a comprehensive educational platform that empowers learners across domains-spanning computer science and programming, school education, upskilling, commerce, software tools, competitive exams, and more.","founder":[{"@type":"Person","name":"Sandeep Jain","url":"https://in.linkedin.com/in/sandeep-jain-b3940815"}],"sameAs":["https://www.facebook.com/geeksforgeeks.org/","https://twitter.com/geeksforgeeks","https://www.linkedin.com/company/1299009","https://www.youtube.com/geeksforgeeksvideos/"]}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Java","item":{"@type":"Thing","@id":"https://www.geeksforgeeks.org/category/java/"}},{"@type":"ListItem","position":2,"name":"command-line-arguments-in-java","item":{"@type":"Thing","@id":"https://www.geeksforgeeks.org/java/command-line-arguments-in-java/"}}]}
{"@context":"https://schema.org","@type":"VideoObject","name":"Command Line Arguments in Java","description":"Learn how to use command-line arguments in Java to pass input values when running a program. Command-line arguments are provided as space-separated values and are passed to the main() method as a string array. You can access and manipulate these arguments within your Java program. The examples demonstrate how to retrieve and print command-line arguments. nbspFor more details, check the article here.","thumbnailUrl":["https://media.geeksforgeeks.org/courses/CommandLineArgumentsinJava/CommandLineArgumentsinJava20241224111405.jpg","https://media.geeksforgeeks.org/courses/CommandLineArgumentsinJava/CommandLineArgumentsinJava20241224111405-seo.png","https://media.geeksforgeeks.org/courses/CommandLineArgumentsinJava/CommandLineArgumentsinJava20241224111405-small.png"],"uploadDate":"2020-10-15T21:16:12Z","duration":"PT0H3M54S","contentUrl":"https://www.geeksforgeeks.org/videos/command-line-arguments-in-java/"}
| theme-color | #308D46 |
| image | https://media.geeksforgeeks.org/wp-content/cdn-uploads/gfg_200x200-min.png |
| og:image:type | image/png |
| og:image:width | 200 |
| og:image:height | 200 |
| facebook-domain-verification | xo7t4ve2wn3ywfkjdvwbrk01pvdond |
| og:site_name | GeeksforGeeks |
| og:image | https://media.geeksforgeeks.org/wp-content/uploads/20241227111123375183/cmd.png |
| article:section | Java |
| article:tag | java-basics |
| og:type | article |
| og:locale | en_US |
| article:published_time | 2016-08-16 19:37:33+00:00 |
| article:modified_time | 2026-05-28 12:22:57+00:00 |
| og:updated_time | 2026-05-28 12:22:57+00:00 |
| og:image:secure_url | https://media.geeksforgeeks.org/wp-content/uploads/20241227111123375183/cmd.png |
| msapplication-TileImage | https://www.geeksforgeeks.org/wp-content/uploads/gfg_200X200.png |
| next-head-count | 43 |
Links:
Viewport: width=device-width, initial-scale=1.0, minimum-scale=0.5, maximum-scale=3.0
Robots: index, follow, max-image-preview:large, max-snippet:-1