what are instance variables and class variables in java?
What is the difference between class variables and instance variables in Java? ... Instance variables are declared in a class, but outside a method, constructor or any block. Class variables also known as static variables are declared with the static keyword in a class, but outside a method, constructor or a block.