Function Parameters in Java
Here is the implementation of the Function Parameter in java language:
/*package whatever //do not write package name here */
import java.io.*;
public class Main {
// Method definition with parameters
static void printSum(int X, int Y)
{
System.out.println(X + Y);
}
public static void main(String[] args)
{
// Method call with arguments
printSum(4, 5);
}
}
Output
9
Function Parameters in Programming
Function Parameters are used to declare the input values that a function expects. The parameters of a function play a significant role while defining the function so that whenever we call the function, we ensure that necessary arguments are passed to the function. In this article, we will dive deep into Function Parameters in Programming across various programming languages.
Table of Content
- What are Function Parameters?
- Function Parameters in C
- Function Parameters in C++
- Function Parameters in Java
- Function Parameters in Python
- Function Parameters in C#
- Function Parameters in Javascript