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
Which package is imported by default?
what is optional in java 8?
How do you define a set in java?
What is an interface in java? Explain
What is multi-catch block in java?
What is java in layman terms?
Is oracle charging for java?
Explain reverse a linked list iterative solution in java?
What are the benefits of immutable objects?
how come we know the object is no more used in the class?
Are there structures in java?
What is thread count in java?
Why is singleton not thread safe?
How do you empty a list in java?
How objects of a class are created if no constructor is defined in the class?