In this program, You will learn how to implement a static method in java.
static void display() {
//statement
}
class Main {
static int x = 10;
static void display() {
System.out.println("The value of x is :" + x);
}
public static void main(String args[]) {
display();
}
}
The value of x is :10