0

What is parameters in java ? I didn't understand.

6th Nov 2018, 11:58 PM
ayush yadav
ayush yadav - avatar
3 Réponses
+ 15
parameters are values passed to a function to perform some more operation which were not possible without those values passed as parameter . A parameter can be variable of some data type , constant etc . //see this example code from 3rd lesson https://www.sololearn.com/learn/Java/2152/ class MyClass { static void sayHello(String name) { System.out.println("Hello " + name); } public static void main(String[ ] args) { sayHello("David"); sayHello("Amy"); } } //here "name" variable takes values of Strings passed as paramater to method sayHello( String name){} . . //btw U might have not finished method lesson yet , so U got confused , just keep learning ☺👍
7th Nov 2018, 5:23 AM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 1
They are the part of program as we can say body of a program Take a simple example as u r a person suppose person is a program and all part dat u do is ur parameter i.e. u take the part of ur body inside the parameter i.e. parameter is a combination of ur all body part or program //Hope u get it
7th Nov 2018, 2:17 AM
Harsh Agrawal
Harsh Agrawal - avatar
0
Google is your friend bro... Sorry i dont mean to be rude.
7th Nov 2018, 1:06 AM
Ebrus Johnson
Ebrus Johnson - avatar