I guess i got it...
A method should be declared as static if :
1. It has no reference to a instance variable.
2. If we want to make sure that the method shouldn't be overridden.
Then we can define the method as a static method....
If i'm wrong then please correct me...or if there's any other point which should be mentioned then please let me know.
Thanks for your replies..
Vasiq Molvizadah wrote:We declare main method as static just to make sure that..there's only one main method in a specific class...
anbarasu aladiyan wrote:
But what's the main use of using a Static method....that's my question.
its a big topic. Tell me why we need to declare main method as static type ??
If you know the answer fo the above question, that is the answer for your question too.