---
title: "What is the difference between static and non-static variables?"  
description: "What is the difference between static and non-static variables?"  
author: "Sumit Kesarwani"  
published: 2014-08-26  
updated: 2020-09-17  
canonical: https://www.mindstick.com/interview/2022/what-is-the-difference-between-static-and-non-static-variables  
category: "java"  
tags: ["java"]  
reading_time: 1 minute  

---

# What is the difference between static and non-static variables?

A static variable is associated with the class as a whole rather than with specific instances of a class. Non-static variables take on unique values with each object instance.

## Answers

### Answer by Sumit Kesarwani

A static variable is associated with the class as a whole rather than with specific instances of a class. Non-static variables take on unique values with each object instance.


---

Original Source: https://www.mindstick.com/interview/2022/what-is-the-difference-between-static-and-non-static-variables

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
