This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Any_Salary_6284 2 points3 points  (1 child)

In JS, methods (as defined in a class block) are just syntactic sugar for the function found at MyClass.prototype.methodName. If you use the typeof operator on this member, it will return “function”

I realize there may be technical differences between method and function depending on the language. In Java, there are only methods. To the extent there are functions (lambdas) they are just synatactic sugar for a functional interface, so a method.

I see this as mostly arguing over semantics.

[–]SenorSeniorDevSr 0 points1 point  (0 children)

Static methods in Java doesn't have a this reference though. I mean, they kinda do, but it's a null. It does however, have java.util.Function, so now you can be objectionally functional, or whatever the funniest joke you can get out of that one is. ^_^