Home  >  Article  >  Java  >  What does args mean in java?

What does args mean in java?

藏色散人
藏色散人Original
2019-05-22 16:13:2632408browse

In Java, args is the abbreviation of arguments, which refers to the name of a string variable. It is a reference variable. It is just a code name. It is just a default name. You can choose it by yourself. Generally, it is habitual to write it down. String[] args is the formal parameter of the main function and can be used to obtain the parameters entered by the command line user.

What does args mean in java?

1. String variable names (args) are reference variables. They are just name codes and you can choose them yourself.

2. Generally speaking, it is used to store string arrays. If you remove it, you will not know what type the variable declared by "args" is.

3. If there is public static void main, it means that when you RUN this program, this part will be RUN;
4. Everything you write in other locations is designed for this MAIN. args is the abbreviation of arguments. It is just a default name and is generally written as usual.
5. It is the variable name of a string array. If it is not the keyword args, it is the abbreviated default name of arguments. Generally, it is written as usual. You can change it to other names.

6. String[] args is the formal parameter of the main function, which can be used to obtain the parameters entered by the command line user.
7. Java itself does not have a main function without String args[]. If String args[] is removed from the Java program, an error will occur.

is as follows:

You can set parameters from run config, as shown below:

What does args mean in java?

Get this args Set the parameter "test" just now and print it out:

What does args mean in java?

The above is the detailed content of What does args mean in java?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:What is java8?Next article:What is java8?