The static member functions do not have an object scope and they do not possess any sort of control over 'this' pointer of the class. When a function is declared as static that is a static method of that class creates only one copy , that is that function or method itself throughout the whole program The major practice of static method is when the programmer requires to have a method which is available even when the class’s object is not created .
Code:
static return _type method_name()
//Static method defined with static keyword
{
statement1;
statement2;
//Statements for execution inside static method
..........
..........
}
Bookmarks