Java 03: Functions
Uploader Comments ( gorilla3d )
Top Comments
-
not clear too advanced for a beginer
-
yeah thats true its called methods
All Comments (20)
-
can you help me to solve this problem?
i really need to solve this. . . .
-
5.write a program that will compute for n! which is the product of all number from 1 ton? then can you convert in function please. . . .tnx :-)
-
can you help me for my java problem
1. write a program that will ask the user to enter a number n and display the number from 1 to n on single line?
2.write a program that will display the even number from 1 to 100?
3.given the value of n from the user, write a program that will display the first n even number. Ex. if n=5, then display the first 5 even integers which are 2,4,6,8,10?
4.write a program which accepts a number n and displays the sum of even numbers from 1 to n?
-
@stedav functions and methods are the same thing. Method is just the name that they receive talking about object oriented programming, but actually it is the same thing after all, it's like synonims.
-
Thank you very much.
-
not very clear
-
Not bad, needs work but not bad
- Loading comment...
Will someone, please, explain to a novice what it means when a function returns or doesn't return something? Return where? And what is the difference?
Kasatka1984 3 years ago
When a function returns something you can used that returned value.
ie.
function add($v1, $v2) {
return $v1 + $v2;
}
$myvalue = add(1, 2);
// now $myvalue = 3
If you never had a return value then it wont be possible to have $myvalue = 3
gorilla3d in reply to Kasatka1984 (Show the comment) 3 years ago