Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   parameter vs argument (http://www.velocityreviews.com/forums/t546923-parameter-vs-argument.html)

Roedy Green 10-25-2007 03:38 PM

parameter vs argument
 
Has anyone run across an official definition of argument and parameter
for Java?
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

Daniel Dyer 10-25-2007 04:13 PM

Re: parameter vs argument
 
On Thu, 25 Oct 2007 16:38:31 +0100, Roedy Green
<see_website@mindprod.com.invalid> wrote:

> Has anyone run across an official definition of argument and parameter
> for Java?


Not specifically for Java, but the only interpretation I've seen that
doesn't use the terms interchangeably is that an argument is a specific
instance of a parameter.

E.g, in the following example, the parameter for doSomething is anInteger
and the argument is 4.

public static void doSomething(int anInteger)
{
System.out.println("The argument was " + anInteger);
}

public static void main(String[] s)
{
doSomething(4);
}

Dan.

--
Daniel Dyer
http://www.uncommons.org

Eric Sosman 10-25-2007 04:29 PM

Re: parameter vs argument
 
Roedy Green wrote On 10/25/07 11:38,:
> Has anyone run across an official definition of argument and parameter
> for Java?


JLS 8.4.1 defines "formal parameter" and refers to
"actual argument expressions" that supply the initial
values of the "parameter variables." This is consistent
with the practice in some other languages: The parameter
is the local variable in the method/function/subroutine/
procedure/lambda expression/whatever, and the argument
is the caller-supplied value/reference/thingy.

--
Eric.Sosman@sun.com

Roedy Green 10-25-2007 05:45 PM

Re: parameter vs argument
 
On Thu, 25 Oct 2007 12:29:06 -0400, Eric Sosman <Eric.Sosman@sun.com>
wrote, quoted or indirectly quoted someone who said :

> JLS 8.4.1 defines "formal parameter" and refers to
>"actual argument expressions" that supply the initial
>values of the "parameter variables." This is consistent
>with the practice in some other languages: The parameter
>is the local variable in the method/function/subroutine/
>procedure/lambda expression/whatever, and the argument
>is the caller-supplied value/reference/thingy.


thanks. I have written new entries for
http://mindprod.com/jgloss/parameters.html
http://mindprod.com/jgloss/arguments.html
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

Wayne 10-25-2007 10:15 PM

Re: parameter vs argument
 
Roedy Green wrote:
> On Thu, 25 Oct 2007 12:29:06 -0400, Eric Sosman <Eric.Sosman@sun.com>
> wrote, quoted or indirectly quoted someone who said :
>
>> JLS 8.4.1 defines "formal parameter" and refers to
>> "actual argument expressions" that supply the initial
>> values of the "parameter variables." This is consistent
>> with the practice in some other languages: The parameter
>> is the local variable in the method/function/subroutine/
>> procedure/lambda expression/whatever, and the argument
>> is the caller-supplied value/reference/thingy.

>
> thanks. I have written new entries for
> http://mindprod.com/jgloss/parameters.html
> http://mindprod.com/jgloss/arguments.html


The terms are interchangeable. But I'm sure we could
have a long parameter on this subject.

-Wayne

Andrew Thompson 10-26-2007 04:19 AM

Re: parameter vs argument
 
Wayne wrote:
...
>The terms are interchangeable. But I'm sure we could
>have a long parameter on this subject.


(chuckle)

--
Andrew Thompson
http://www.athompson.info/andrew/

Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.asp...neral/200710/1


Mark Space 10-26-2007 04:43 AM

Re: parameter vs argument
 
Andrew Thompson wrote:
> Wayne wrote:
> ..
>> The terms are interchangeable. But I'm sure we could
>> have a long parameter on this subject.

>
> (chuckle)
>


Yeah that was a good one. I was going to say that Java methods have
parameters and arguments are what we have here. ;-)



Lew 10-26-2007 04:53 AM

Re: parameter vs argument
 
Mark Space wrote:
> Yeah that was a good one. I was going to say that Java methods have
> parameters and arguments are what we have here. ;-)


Must ... not ... quote ... Monty Python ... ... must ... resist . . . .

--
Lew

Andreas Leitgeb 10-26-2007 08:12 AM

Re: parameter vs argument
 
Lew <lew@lewscanon.com> wrote:
> Mark Space wrote:
>> Yeah that was a good one. I was going to say that Java methods have
>> parameters and arguments are what we have here. ;-)

> Must ... not ... quote ... Monty Python ... ... must ... resist . . . .

no!

Andrew Thompson 10-26-2007 12:15 PM

Re: parameter vs argument
 
Lew wrote:
>> Yeah that was a good one. I was going to say that Java methods have
>> parameters and arguments are what we have here. ;-)

>
>Must ... not ... quote ... Monty Python ... ... must ... resist . . . .


I hate to admit this, but I am not entirely sure of the
Monty Python quote you are referring to, and I'm burning
with curiosity.

The only sketch I can think of that comes close, is the
'I want an argument' sketch.

<poorly paraphrased MP>
"Oh, I'm sorry, ..you wanted an argument? This is 'abuse'."
</poorly paraphrased MP>

--
Andrew Thompson
http://www.athompson.info/andrew/

Message posted via http://www.javakb.com



All times are GMT. The time now is 10:42 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.