24.9k views
2 votes
What is the difference between instance variables and static variables?

User Oldovets
by
6.7k points

1 Answer

4 votes

Answer:

Explanation:

Instance variables are created when an object is created with the use of the keyword 'new' and destroyed when the object is destroyed. Static variables are created when the program starts and destroyed when the program stops

User TacheDeChoco
by
7.6k points