A method that has the static keyword in the declaration is known as the static method. In other words, a method that belongs to a class rather than an instance of a class is known as a static method. We can also create a static method by using the keyword static before the method name. The main benefit of a static method is that we can invoke the static method without even creating an object. It can access static data members and also change their values and is also used to create an instance method. The main() method is a common example of the static method.
#Source_code
#OOP_Concepts_java
#Static_method_in_java
#126
#Source_code
#OOP_Concepts_java
#Static_method_in_java
#126