Skip to content

Latest commit

 

History

History
9 lines (6 loc) · 294 Bytes

File metadata and controls

9 lines (6 loc) · 294 Bytes

09 — Static vs Instance members

Static members

  • static fields and methods belong to the class itself. Use for shared state/utility methods.

Instance members

  • Each object gets its own copy of instance fields.

Example: StaticInstanceExample.java shows differences and common pitfalls.