---
title: "What is the difference between an instance variable and a static variable in java?"  
description: "What is the difference between an instance variable and a static variable in java?"  
author: "Sumit Kesarwani"  
published: 2014-03-26  
updated: 2020-09-15  
canonical: https://www.mindstick.com/interview/1940/what-is-the-difference-between-an-instance-variable-and-a-static-variable-in-java  
category: "java"  
tags: ["java"]  
reading_time: 1 minute  

---

# What is the difference between an instance variable and a static variable in java?

Class variables are called static variables. There is only one occurrence of a class variable per JVM per class loader.When a class is loaded the class variables are initialized.

Instance variables are non-static and there is one occurrence of an instance variable in each class instance.Also known as a member variable or a field.

## Answers

### Answer by Sumit Kesarwani

Class variables are called static variables. There is only one occurrence of a class variable per JVM per class loader.When a class is loaded the class variables are initialized.

Instance variables are non-static and there is one occurrence of an instance variable in each class instance.Also known as a member variable or a field.


---

Original Source: https://www.mindstick.com/interview/1940/what-is-the-difference-between-an-instance-variable-and-a-static-variable-in-java

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
