+ 1
What is static method
3 Respostas
+ 11
A static method is one type of method which doesn't need any object to be initialized for it to be called. Program execution begins from there without an object being created.
consider the following example :
public class Program
{
public static void main(String[] args) {
display();
}
static void display()
{
System.out.println("Java is my favorite programming language.");
}
}
+ 5
its a static variable which you can call from main without having to create a instance of class.
you have 3 variable types in class
local
instance
static