Possible Duplicate:
static function/variable
Tell me the different combination of static like object static and variable normal , or variable static function normal , object static function normal etc etc
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A static variable and function are limited in scope they are declared in. Additionally, variables defined in functions will persist their value across function calls if defined as static.
A static method or member on an object can be used directly without a specific instance of the object, i.e. no this pointer will be automatically passed into the method. Naturally this means you can only access other static methods and variables from within a static method.