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 variables are stored in stack?
How do you represent a space in regex java?
How to perform quicksort in java?
Is string is a data type in java?
Can you pass by reference in java?
What is native method in java?
How do you write methodology?
What is are packages?
what do you mean by classloader?
In java, how many ways you can take input from the console?
What is a conditional equation?
What is the properties class?
extending thread class or implementing runnable interface. Which is better? : Java thread
How to retrieve data from database in java using arraylist?
How can we create a thread in java?