Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > parameter vs argument

Reply
Thread Tools

parameter vs argument

 
 
Roedy Green
Guest
Posts: n/a
 
      10-25-2007
Has anyone run across an official definition of argument and parameter
for Java?
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
 
Reply With Quote
 
 
 
 
Daniel Dyer
Guest
Posts: n/a
 
      10-25-2007
On Thu, 25 Oct 2007 16:38:31 +0100, Roedy Green
<> 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
 
Reply With Quote
 
 
 
 
Eric Sosman
Guest
Posts: n/a
 
      10-25-2007
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.

--

 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      10-25-2007
On Thu, 25 Oct 2007 12:29:06 -0400, Eric Sosman <>
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
 
Reply With Quote
 
Wayne
Guest
Posts: n/a
 
      10-25-2007
Roedy Green wrote:
> On Thu, 25 Oct 2007 12:29:06 -0400, Eric Sosman <>
> 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
 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      10-26-2007
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

 
Reply With Quote
 
Mark Space
Guest
Posts: n/a
 
      10-26-2007
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.


 
Reply With Quote
 
Lew
Guest
Posts: n/a
 
      10-26-2007
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
 
Reply With Quote
 
Andreas Leitgeb
Guest
Posts: n/a
 
      10-26-2007
Lew <> 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!
 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      10-26-2007
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Variable argument function as a parameter of a variable argument function AikidoGuy C Programming 11 11-21-2011 10:43 PM
Template argument as template argument nw C++ 0 04-14-2008 01:36 PM
Function pointers, variable argument functions calling other variable-argument functions (sort of) S?ren Gammelmark C Programming 1 01-07-2005 09:41 PM
How to pass variable argument list to another function w/ variable argument list? Ben Kial C Programming 1 11-15-2004 01:51 AM
defaulting argument to previous argument Bhushit Joshipura C++ 5 12-30-2003 03:21 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57