| Feature | Static Method | Non-Static Method |
| Access | Accessed using the class name directly or through an object reference | Accessed only through an object reference |
| Memory | No memory is allocated for “this” keyword | Memory is allocated for “this” keyword |
| Invocation | Invoked using the class name directly or through an object reference | Invoked using an object reference |
| Overriding | Cannot be overridden | Can be overridden |
| Utility | Used for utility methods that are not specific to individual objects | Used for behavior specific to individual objects |
| Access to Static Members | Can access static members directly | Can access static members directly or through the class name |
| Access to Non-Static Members | Cannot access non-static members directly | Can access non-static members directly or through “this” keyword |
EasyExamNotes.com
Difference between static and non static methods in Java
Source: https://easyexamnotes.com/difference-between-static-and-non-static-methods-in-java/
Discussion
Ask a question, share your thoughts or report an error.
Sign in to participate in the discussion.
Join the discussion