← Back to Java

Static vs Instance Variables

Javajava

The Question

What is the difference between static and instance variables in Java?

What a Strong Answer Covers

  • static = class-level single shared copy
  • instance = per-object copy
  • static in Method Area
  • instance in Heap
  • static accessed by class name
  • static methods can only access static members

Related Questions

  • JVM vs JRE vs JDK
  • Java Platform Independence
  • How JVM Works
  • Main Features of Java
  • public static void main

Practice This Question

Get AI-graded feedback on your answer with follow-up probes on weak points.

Take the Free Assessment
GrindQuestionsAITechnical interview assessment
TermsPrivacyAbout