Non-Static | Static |
---|---|
These are the variables whose memory space is created each and every time whenever we create an object | These are the variables whose memory space is created only once whenever the class is loaded in the main memory |
Instance data members are used to store specific value | static data members are used to store common values |
Each and every instance data member must be accessed with respect to object name | Each and every data member must be accessed with respect to class name |
Non Static Method | Static Method |
---|---|
These are used for performing repeated operations such as reading the record of for, database etc. | These are recommended to perform one time operation such as opening a file, database etc. |
We can access non-static methods wrt object name | We can access static method wrt class name |