how does the static keyword vary to not using it with a method, could you give me an example where the result is different because the word is used and not used, thanks. Andy.
Share
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 method can be called on the class, like this:
A non-static method can only be called on an instance of that class, like this:
In a static method, you only have access to other static methods and members. So, to use the this keyword in a method, it must not be declared static. Static methods give functionality to the class itself, while non-static methods give functionality to an object of that class.