

Hi,
Here is the answer.
The static modifier is used to create variables and methods that will exist independently of any instances created for the class. All static members exist before you ever make a new instance of a class, and there will be only one copy of a static member regardless of the number of instances of that class.
all instances of a given class share the same value for any given static variable.
Static can not refer to this or super.
static methods can't be overridden!
Static variables are also known as class variables
When the program starts the static blocks, methods, and variables executed first.
For example- here is the program
public class staticdemo {
static {
System.out.println("hi this is static block");
}
public static void main(String[] args) {
System.out.println("this is main");
}
}
Thanks.

Hi,
Static means one per class not per instance.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.