DEV Community

Pavitra Aravind
Pavitra Aravind

Posted on • Edited on

What is static and Non static method in java?

  • Static variable is like a global variable and is available to all methods.
  • static variable will have only one memory copy.
  • Non static variable is like a local variable and they can be accessed through only instance of a class.
  • Non staic variables will have mutiple copies in memory.

Top comments (0)