0
What are parameters in java
2 Answers
+ 11
in simple words , parameters are values which are passed as inputs to a function/method
//for example U want to print your name , for that U pass "Devansh" as parameter to the function :::
method call :::
showName("Devansh");
method definition :::
static void showName (String name){
System.out.println(name);
}
+ 1
A parameter is something that makes a function more flexible. If you think of a function as a program or a machine, its parameters are its inputs. If you don't give a function parameters, it will always output the same thing. Most functions have them so they can be used in various situations.
If you haven't yet, then you should definitely try sololearn's Java course.
https://www.sololearn.com/Course/Java/