0
What is parameters in java ? I didn't understand.
3 odpowiedzi
+ 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 ☺👍
+ 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
0
Google is your friend bro...
Sorry i dont mean to be rude.