My 2 Cents Static Functions

Swati Mishra

Content Writer
Static functions can only access static variables and, it is not access the non static variable. We use the static class name to access the static function.
Syntax
ClassName:: StaticFunctionName;
Example
 

Doominic anderson

White Belt
A static function is defined by using static keyword.When a function is declared as static it doesn't matter how many objects of that class are created,there is only one copy of the static member. Static member is independent from any particular object of the class. Static function can be called even if no object of the class exist and the static member are accessed using only the class name and the scope resolution operator "::" .
 
Top