answersLogoWhite

0


Best Answer

In Java, the main() method is typically written something like this:public static void main(String [ ] args)

The argument is what is in parentheses, in this case: "String [] args". I believe this can also be written as "String args[]". It refers to parameters received by the Java program from the command line. That is, the user can write, for example:

java MyClass info1 info2

In this example, "info1" and "info2" will be received by the main method, in the args[] array.

User Avatar

Wiki User

8y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

13y ago

To let us pass run-time arguments to the java program that is being executed

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the argument of main()method?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is the use of passing an argument by value?

Passing an argument by value means that the method that receives the argument can not change the value of the argument. Passing an argument by reference means that the method that receives the argument can change the value of the incoming argument, and the argument may be changed in the orignal calling method.


What is the name given to the technique whereby a function argument can be modified by passing a pointer to the argument?

Call_by_reference


What argument passes in a method that will reference the content and can change the variable in the method?

That is called passing an argument by reference.


What is the difference between parameters and arguments in VB?

In programming languages, a parameter and an argument are the same thing; there is no actual difference between the two. Although a few languages do differentiate between an actual argument and a formal argument by calling one a parameter and the other an argument (or vice versa), the terms are universally interchangeable. That is; there is no single definition that applies to any one language, including Visual Basic. The language may have a convention, but there's no reason to follow that convention. Personally, I prefer the term argument and use the terms formal argument and actual argument whenever I need to specifically differentiate one from the other. In this way I can refer to them in a consistent but language-agnostic manner. Only a Pedant would argue that the terms parameter and argument have a specific meaning to a specific language, even when the creators of that language use the terms interchangeably themselves. To clarify, an actual argument is the argument being passed to a function while a formal argument is the argument that is used by the function. The two will always have the same value, but they are not the same argument. For instance, consider the following function definition: f (int a) { print a*2 } Whether we regard 'a' as being a parameter or an argument is immaterial -- it is a formal argument or formal parameter, whichever you prefer. The meaning is clarified by using the word "formal". Now consider the calling code: b = 42 f (b) Here, b is the actual argument (or actual parameter) being passed to the function f. Note that a and b are not the same variable or reference. That alone means there is no reason to differentiate them; the meaning of argument or parameter is implied by the context alone. It doesn't matter whether the function uses pass by value or pass by reference semantics. When passing arguments by value, a is simply a copy of b (independent variables with the same value). When passing by reference, a refers to the same memory address as b (a is an alias for b). In either case, the function uses the formal argument named a while the calling code uses the actual argument named b. In other words, the names are only accessible from within the scope in which they are declared, even if they refer to the same memory address. Of course, a function may pass one of its formal arguments to another function. Thus with respect to the calling function, its formal argument becomes an actual argument to the function being called.


What gives an argument warrant?

Supporting evidence

Related questions

What does counter argument mean?

A counter argument is an argument made against another argument.


What is the use of passing an argument by value?

Passing an argument by value means that the method that receives the argument can not change the value of the argument. Passing an argument by reference means that the method that receives the argument can change the value of the incoming argument, and the argument may be changed in the orignal calling method.


What is more common inductive argument or deductive argument?

Deductive arguments are more common than inductive arguments. Deductive reasoning begins with a general statement and applies it to a specific case, leading to a certain conclusion. Inductive reasoning begins with specific observations and generates a general hypothesis.


What are the 4 fundamentals of logic?

Argument Deductive argument Inductive Argument Analogy


What is an informal argument?

an argument with information


What is the correct spelling for argument?

argument


What makes an argument an argument?

An argument is inductive when it is based on probability, such as statistics. In an inductive argument, if the premises are true, the conclusion is probably true.


What if an argument does not commit a fallacy?

If an argument does not commit a fallacy, it means that the reasoning provided supports the conclusion without any logical errors. This indicates that the argument is valid and that the premises lead to a justifiable conclusion. It also suggests that the argument is logically sound and can be considered a strong or persuasive piece of reasoning.


Which element is needed for a sound argument?

Evidence to support the argument is needed for a sound argument.


What is an argument from design?

An argument from design is a theological term for a teleological argument - an argument for the existence of God, such that because nature is orderly, it is evidence of a designer.


What is the thesis of a research essay?

The claim is the argument you plan to prove.


Is the design argument a convincing argument?

The design argument, which posits that the complexity and order in the universe suggest a designer, is convincing to some people because it provides a logical explanation for the existence of complex systems. However, others find it unconvincing due to alternative explanations, like natural selection, and the lack of direct evidence for a designer. Ultimately, the persuasiveness of the design argument can vary depending on an individual's perspective and beliefs.