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
What is the different between get and post?
What an i/o filter?
What are internal variables?
what do you mean by classloader in java?
how we can make a read-only class in java?
Define how can we find the actual size of an object on the heap?
What are operators and its types?
Can an interface implement another interface?
What is the purpose of sizeof operator?
What is field name?
Why we used vector class?
what is interface in java? Explain
Which is bigger double or float?
What is the full meaning of java?
How do you insert a line break?