About Static
If we use a static keyword with a function that means-
- The function can only access static variables.
- Cannot use the this keyword inside that function.
The memory for a static variable is allocated once during the program's execution and retains its value throughout the program's lifetime.