0

What are parameters in java

15th Mar 2018, 4:26 PM
Devansh Gupta
Devansh Gupta - avatar
2 ответов
+ 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); }
15th Mar 2018, 5:27 PM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 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/
15th Mar 2018, 4:47 PM
Just A Rather Ridiculously Long Username