r/learnjava • • Feb 08 '22

Does Java really not have functions?

Hi, I'm brand new to Java.

I googled "Does Java have functions" and the first/top result says, "There are no functions per se in Java. All you've got is methods."

I'm not sure what the latter part of that means, but you really can't create functions in Java?

Thanks, sorry for the noob question

7 Upvotes

23 comments sorted by

View all comments

-2

u/DDDDarky Feb 08 '22

I assume you read that on stackexchange, the answer is not entirely true, therefore not the most upvoted. Why would you take such answer?

0

u/jgonzalez-cs Feb 08 '22

It's the first result on Google, as I said

If I knew the answer was untrue, then I would've never had to make this post now would I haha

4

u/[deleted] Feb 08 '22 edited Feb 09 '22

I'm not sure what the latter part of that means, but you really can't create functions in Java?

If you follow the link, you will find explanation: https://softwareengineering.stackexchange.com/questions/222345/whats-the-difference-between-a-function-and-a-method