Actual parameters:
The parameters that appear in the method invocation (while calling the method)are called actual parameters

Formal parameters:
The parameters that appear in the method definition are called formal parameters.

Class para
{
Public void add(int a, int b)           //a and b are formal parameters
{
int sum= a+b;
System.out.println("the sum is "+ sum);
}
Public static void main ()
{
int num= 4;
int num1=5;
Add(num, num1);                       //num, num1 are actual parameters
}
}

LEAVE A REPLY

Please enter your comment!
Please enter your name here