Difference between an argument and a parameter?

Answer Posted / dev

The words argument and parameter are often used
interchangeably although the C++ Standard makes a clear
distinction between the two.

An argument is an expression in the comma-separated list in
a function call or the operand of a throw-statement

A parameter is an object or reference that is declared in a
function declaration or definition (or in the catch clause
of an exception handler);


This example demonstrates the difference between a
parameter and an argument:

void func(int n, Object obj); //n and obj are parameters

static void main(String s[])
{
Object p = new String("hi");
func(5, p); //5 and p are arguments
}

Is This Answer Correct ?    155 Yes 23 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the range of a character variable?

551


What is an exception? difference between Checked and Unchecked exception in Java

568


What do you mean by flow of struts?

754


Can we have multiple classes in a single file?

520


Define the term string pool?

592






How many digits is int32?

545


What are the differences between include directive and include action?

553


What are the differences between path and classpath variables?

511


What is sizeof () operator?

575


What does provide mean construction?

560


What is a nested list?

528


How does compareto work in java?

589


Explain importance of inheritance in java?

609


What do you understand by the term string pool?

572


How many classes can any class inherit java?

516