ALERT

[WEBINAR] Extract Value From Your Data Through Micro-Queries

Static Method

Definition - What does Static Method mean?

In Java, a static method is a method that belongs to a class rather than an instance of a class. The method is accessible to every instance of a class, but methods defined in an instance are only able to be accessed by that member of a class.

Techopedia explains Static Method

Java allows developers to define static methods, which are available to every instance of a class. In an instance of a class, the methods are able to access both variables in an instance and those belonging to a class, while static methods cannot access instance variables or methods directly. Instead, static methods have to use object reference. The most common use for static methods is to access static variables. They are accessed by the class name and a dot (.) followed by the name of a method. They are declared with the keyword "static" when defining a method. Static methods can be accessed without having to create a new object.

Share this: