Function Arguments in Java
Here is the implementation of the Function Arguments in java language:
/*package whatever //do not write package name here */
import java.io.*;
class GFG {
// 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 4 and 5
printSum(4, 5);
}
}
Output
9
Function Arguments in Programming
Function Arguments are values or variables passed into a function when it is called. The arguments to a function play a significant role as they provide the necessary input for the function to perform its intended task. In this article, we will discuss what are Function Arguments in Programming across various programming languages.
Table of Content
- What are Function Arguments?
- Function Arguments in C
- Function Arguments in C++
- Function Arguments in Java
- Function Arguments in Python
- Function Arguments in C#
- Function Arguments in Javascript