Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
Azure
Blockchain
Devops
Ask a Question
What is the difference between static and non-static variables in Java?
Home
JAVA
What is the difference between static and non-static variables in Java?
+1
vote
asked
Feb 1, 2023
in
JAVA
by
sharadyadav1986
What is the difference between static and non-static variables in Java?
static-java
non-static-java
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Feb 1, 2023
by
sharadyadav1986
A static variable is shared among all instances of a class and is created only once, while a non-static variable is unique to each instance of a class and is created every time an object is created.
...