Difference between an argument and a parameter?
Answer Posted / sagar
Whenever we are define a method with objects or references or variables then that objects or references or variables are called as parameters.
Whenever we are calling using that method with their objects or references or variable values through that class object is called arguments
Example :
class abc
{
public void display(int a,int b,)//where a and b are parameters.
{
System.out.println("The values of passed arguments are: a="+a+"b="+b);
}
public static void main(String args[])
{
abc a=new abc();
a.display(400,500);//where 400,500 are arguments.
}
}
| Is This Answer Correct ? | 11 Yes | 2 No |
Post New Answer View All Answers
What is a classloader in java?
What are the restrictions that are applied to the java static methods?
What are the differences between graph and tree?
What are default methods ?
What is fail fast in java?
What is the final class modifier?
What are operators and its types?
How do you sort a string in java?
What are local variables?
how to split string in java?
Can you call a method on a null object?
How do you compare arrays in java?
How long will it take to learn java?
Is class is a data type?
What are the Main functions of Java?