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
Difference between current previous versions of Java?
Can a class have more than one object?
Can I declare a class as private?
How do you call a reference in java?
Which oo concept is achieved by using overloading and overriding?
What do you understand by a Static Variable?
Difference between object and reference?
what is ststic with example
What is charat java?
Explain the transient field modifier?
What is identifier give example?
Explain the JDB in depth & command line.
Why java is object oriented?
What is size of int in java?
Can a class be private in java?