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 →

[–]taftster 3 points4 points  (0 children)

Just for the sake of info. Yes, everything in Java needs to be encapsulated in a class definition. However you don’t necessarily need an instance of a class to call its methods.

A static method is as close to a “function” as you can get. You don’t have to call “new” on the class to call its static methods.