Why use the following: public Function foo() {//code} Instead of public void foo () {//code} ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why use the following: public Function foo() {//code} Instead of public void foo () {//code} ?

The difference on Functions and Methods

2nd Oct 2019, 6:24 PM
Tshego M
Tshego M - avatar
2 Answers
+ 3
I am working on Java and there is no such type of declaration. In java functions are called methods.
2nd Oct 2019, 7:32 PM
A͢J
A͢J - avatar
0
Thanks for the feedback. I saw this question on 1 Facebook group, so I needed to come ask it here to make sure that I didn't skip any lesson nor was I being misled as it's been a while seeing it used when people make examples using FOO.
9th Oct 2019, 4:20 AM
Tshego M
Tshego M - avatar