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 are the java ide's? Explain
How big is a 64 bit float?
What is the purpose of interface?
What are disadvantages of java?
How many bytes are there?
What is the difference between hashset and treeset in java?
Explain restrictions for using anonymous inner classes?
Can a abstract class be defined without any abstract methods?
Is empty in java?
What happens when I use / and % with a negative numerator?
What is array initialization in java?
What are format specifiers in java?
What is java command?
what do you mean by classloader in java?
How do you sort an array in java?