# Command-Line Argument

say it: **“kuh-MAND lyne AR-gyuh-ment”** **/kəˈmænd laɪn ˈɑːrɡjəmənt/**

A string passed to a Java program when it starts.

## What is **Command-Line Argument** in Java?

**Command-Line Argument** — A string passed to a Java program when it starts.

```java
class Greeter {
    public static void main(String[] args) {
        String firstArgument = args[0];
    }
}
```

Level: Apprentice · [More Java terms at this level](https://www.ask-codey.com/glossary?category=java&level=2)

Updated: November 17, 2026

## In other subjects

- [Command-Line Argument in Python](https://www.ask-codey.com/glossary/command-line-argument-python)

Source: https://www.ask-codey.com/glossary/command-line-argument
