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


Please Help Members By Posting Answers For Below Questions

Can we create object of static class?

516


What do you mean by order of precedence and associativity?

535


Can you write a java class that could be used both as an applet as well as an application?

505


How does predicate work in java?

521


What is the advantage of OOP in java?

652






Which containers use a flowlayout as their default layout in java programming?

494


What is tcp and udp?

585


How is final different from finally and finalize?

484


What are the advantages of functions?

510


What differences exist between iterator and listiterator?

556


Is zero a positive integer?

521


Can a final variable be initialized in constructor?

475


What is java and why do we need it? Explain

567


What's the difference between an abstract class and interface in java?

542


What is a java list?

567