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
How many threads can I run java?
What is java life cycle?
What is java and why do we need it? Explain
What does t in java mean?
What is the difference between compile-time polymorphism and runtime polymorphism?
What are scriptlets?
What is the difference between method and means?
Explain an intermediate language?
What is difference overloading and overriding?
Why object class is super class for every class in java?
What’s the difference between constructors and other methods?
How do you test a method for an exception using junit?
What is javac_g?
Can we create object of static class?
Is boolean a wrapper class in java?