Computer Science, asked by Incredible29, 1 year ago

What is the importance of argument in a function in Java ?

Answers

Answered by Palak230
2

Arguments re not important in java only but they re imp. for all the programming languages as they re the values which passed into functions and without these arguments the programes ll become quite boring and useless because of this it is imp. to have arguments in between.

Hope it helps.......


Incredible29: thnx
Palak230: wc
Answered by clementinamaria51
1

rray(xx);

   System.out.println("x[0] = " + x[0]);

Summary

All you need to remember is that

All arguments to methods in Java are pass-by-value.

That, combined with an understanding of the different between primitives and references and careful tracing will allow you to understand any Java method calls.What does this mean? How do I change a parameter? This short tutorial will help you figure out how parameter passing in Java works and will help you avoid some common mistakes.


First let's get the terminology straight. The terms "arguments" and "parameters" are used interchangeably; they mean the same thing. We use the term formal parameters to refer to the parameters in the definition of the method. In the example that follows, x and y are the formal parameters.


We use the term actual parameters to refer to the variables we use in the method call. In the following example, length and width are actual parameters.


   // Method definition

   public int mult(int x, int y)

   {

      return x * y;

   }


   // Where the method mult is used

   in


baljeet72: hiii
Similar questions