Back to Tutorials
TutorialsICSEClass 10Computer Science

An Easy Actual and formal parameters in java

For exampleIn the code given below the concept of actual and formal parameter is used.

Trushna Tejwani29 March 2020
Tutorials

Actual and formal parameters

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.

For more java videos click
https://youtu.be/GeSDLXhzFig

For example
In the code given below the concept of actual and formal parameter is used.

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
}
}

For other java related topics click
https://wordpress-343193-1101484.cloudwaysapps.com/data-type