Skip to content

About Static

If we use a static keyword with a function that means-

  1. The function can only access static variables.
  2. 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.

On this page

No Headings