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 is the byte range?
What is the size of int?
Why does java have two ways to create child threads? Which way is better?
What is difference between equals and hashcode method?
What is the right data type to represent a price in java?
What is hashtable and explain features of hashtable?
What is void data type?
What is an immutable object?
how we can use debug in myeclipse 6.0 in order solve the problems that exist in our program when there are 900 to 1000 pages in a web application
how to split string in java?
What is hashmap in java?
Is it safe to install java on my computer?
What are the legal operands of the instanceof operator?
What is reverse function?
Write code to implement bubble sort in java?