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
Why array is used in java?
What are the access modifiers in java?
What is a parameter in a function?
How do listeners work?
What is anagram word?
Does collectionutils isempty check for null?
What is lambda in java?
What is port number in java?
How many types of classes are there in java?
What is the use of runnable interface?
Write a program to show whether a graph is a tree or not using adjacency matrix.
Which is illegal identifier in java?
If you do not want your class to be inherited by any other class. What would you do?
Which list is sorted in java?
What is the difference between multitasking and multithreading in Java