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 range of a character variable?
What is an exception? difference between Checked and Unchecked exception in Java
What do you mean by flow of struts?
Can we have multiple classes in a single file?
Define the term string pool?
How many digits is int32?
What are the differences between include directive and include action?
What are the differences between path and classpath variables?
What is sizeof () operator?
What does provide mean construction?
What is a nested list?
How does compareto work in java?
Explain importance of inheritance in java?
What do you understand by the term string pool?
How many classes can any class inherit java?